Jump to content

Problem with google customer reviews badge displaying and javascript position


Recommended Posts

Hi,

 

i'm currently trying to add google customer reviews on my prestashop website, everything seems ok.

The only problem is when I activate 'Move javascript to the end', the badge is no longer showing up.

Google explicitly says that the script needs to be at the start of the file, so i'm wondering if someone has an idea to bypass that problem ?

 

 

Link to comment
Share on other sites

  • 3 weeks later...
On 29.11.2017 at 3:07 PM, Alexenn said:

Hi,

 

i'm currently trying to add google customer reviews on my prestashop website, everything seems ok.

The only problem is when I activate 'Move javascript to the end', the badge is no longer showing up.

Google explicitly says that the script needs to be at the start of the file, so i'm wondering if someone has an idea to bypass that problem ?

 

 

 

Hi Alexenn.

How did you add the code? Can you share with me because I added the code but it does not appear on order confirmation page.. this is a major disadvantage for PrestaShop. Thnk you

 

 

Link to comment
Share on other sites

  • 4 months later...

Although this post is dated, it may still be relevant to someone.

Adding

data-keepinline="true"

to the script tag may help you out. For Example, using Google's supplied Customer Review code:

<script data-keepinline="true">
  window.renderOptIn = function() { ...

 

Edited by asapho (see edit history)
Link to comment
Share on other sites

  • 4 months later...
  • 6 months later...
Does anyone have the correct variables for prestashop?

This is the script provided by google.

<script>
  window.renderOptIn = function() {
    window.gapi.load('surveyoptin', function() {
      window.gapi.surveyoptin.render(
        {
          // REQUIRED FIELDS
          "merchant_id": XXXXXX,
          "order_id": "ORDER_ID",
          "email": "CUSTOMER_EMAIL",
          "delivery_country": "COUNTRY_CODE",
          "estimated_delivery_date": "YYYY-MM-DD",

          // OPTIONAL FIELDS
          "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]
        });
    });
  }
</script>

 

Edited by Chrisi1321 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...