Knowledge base | Judge.me

Installing Judge.me 2.0 in an unpublished theme

Knowledge base | Judge.me

Installing Judge.me v2.0 in an unpublished theme

When you change your theme, you need to do 2 things to keep Judge.me working:

  • install our JS files
  • install our widgets according to your installation preferences

When publishing a new theme, Judge.me automatically re-installs our JS files and also emails you to offer free theme concierge service to re-implement your installation preferences (from Installation tab in app settings).

That said, if you want Judge.me to work in your unpublished themes, you can already do some of the work manually, so you can publish your new theme with the confidence that Judge.me keeps working.

Installing the Judge.me JS files

After app install or publishing a new theme, Judge.me automatically installs the following codes.

  • First of all you'll need to add a new snippet called judgeme_core.liquid with the following content:

    {% comment %}
      Please do not edit this file. This file will be updated frequently so any manual changes will be discarded
      It's recommended to include this file right before closing  tag
    {% endcomment %}
    
    {{ shop.metafields.judgeme.settings }}
    {% for count in (0..5) %}
      {% assign metafieldkey = 'htmlmiracle' | append: count %}
      {% assign currentmetafield = shop.metafields.judgeme[metafieldkey] %}
      {% unless currentmetafield %} {% break %} {% endunless %}
      {{ current_metafield }}
    {% endfor %}

    <script data-cfasync="false" type="text/javascript" async src="https://cdn.judge.me/shopifyv2.js"></script> <link rel="stylesheet" type="text/css" media="all" href="https://cdn.judge.me/shopifyv2.css">

  • And then add our judgme_core right before the closing head tag in your layouts/theme.liquid file

So in your published theme you should see the following in your layouts/theme.liquid file:

{% include 'judgeme_core' %}
</head>


For unpublished themes, you can add the judgme_core.liquid file right above closing head tag in your layouts/theme.liquid to make the widgets show in the theme preview of your unpublished theme.

Installing the Judge.me widgets according to your installation preferences

In the Installation tab of our app settings, you can store your installation preferences:

When you publish a new theme, we automatically detect this and send you an email with a link to request free theme concierge service, where we will apply your installation preferences for you.

For unpublished themes, you can do the work yourself already.

The line of code for our review widget needs to be added to your product.liquid template, and is as follows:

<div id='judgeme_product_reviews' class='jdgm-widget jdgm-review-widget' data-product-title='{{ product.title }}' data-id='{{ product.id }}'> {{ product.metafields.judgeme.widget }}</div>


The line of code for our preview badge can be added to:

  • Your collection.liquid template, or a product thumbnail snippet referenced in this template
  • Your product.liquid template, below the product title

The preview badge line of code is as follows:

<div class='jdgm-widget jdgm-preview-badge' data-id='{{ product.id }}'>{{ product.metafields.judgeme.badge }}</div>