Jump to content

How to integrate google Customer Reviews survey opt-in module?

Recommended Posts

I have to add this:

<!-- BEGIN GCR Opt-in Module Code -->

<script src="https://apis.google.com/js/platform.js?onload=renderOptIn"

 async defer>

</script>

 

<script>

 window.renderOptIn = function() {

   window.gapi.load('surveyoptin', function() {

     window.gapi.surveyoptin.render(

       {

// REQUIRED

         "merchant_id": "MERCHANT_ID",

         "order_id": "ORDER_ID",

         "email": "CUSTOMER_EMAIL",

         "delivery_country": "COUNTRY_CODE",

         "estimated_delivery_date": "YYYY-MM-DD",

 

         // OPTIONAL

         "products":[{"gtin":"GTIN1"}, {"gtin":"GTIN2">}],

         "opt_in_style": "OPT_IN_STYLE"

       });

    });

 }

</script>

<!-- END GCR Opt-in Module Code -->

 

 

To the confirmation page, but I'm missing dynamic values for the " "estimated_delivery_date" and gtin1 and gtin2.

 

I figure order id one can use the tag squarespace provides {orderId}  as well as email address.

 

But I can't find other values anywhere, not even customer service knows.

 

Can someone help me?

 

I am trying to collect seller reviews and product reviews so I can show these badges  on shopping ads from google ads.

 

Has anyone done this or have they used a review aggregator? Or is there another service which will accomplish this?

 

THanks!

 

Amber

Link to comment
  • 1 month later...
  • 2 weeks later...
  • 4 months later...
  • 4 months later...

If u have access to order informations, u should have a "created_at" column.

To have an idea of this value, u can juste transform this date and add +7days to it.

Or if u want more realistic data, u can create a function to determine delivery date based on country, delivery mode etc..

PHP version of estimated_delivery_date : 

Quote

date("Y-m-d", strtotime($order->getCreatedAt() . "+7 days"))

 

Edited by BouBooo
Link to comment
  • 1 month later...
  • 1 month later...

I have this so far 

<!-- BEGIN GCR Opt-in Module Code -->
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn"
async defer>
</script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
"merchant_id": 280599083,
"order_id": "{orderId}",
"email": "{customerEmailAddress}",
"delivery_country": "GB",
"estimated_delivery_date": "YYYY-MM-DD" ,
"opt_in_style": "BOTTOM_LEFT_DIALOG"
});
});
}
</script>
<!-- END GCR Opt-in Module Code -->
<!-- BEGIN GCR Language Code -->
<script>
window.___gcfg = {
lang: 'en-GB'
};
</script>
<!-- END GCR Language Code -->

 

just need some JS to pull the date in the order "YYYY-MM-DD" from the order confirmation and add 4 days. anyone know how to write that in js?

Link to comment
  • 4 weeks later...
  • 4 months later...

I did it efficaciously but it appeared at the header and seemed very messy as the nav bar turned into behind it. Is there a way to have it some place else at the web page or make the nav bar disappear?

Link to comment
On 6/29/2021 at 5:35 AM, fsaw333 said:

I did it efficaciously but it appeared at the header and seemed very messy as the nav bar turned into behind it. Is there a way to have it some place else at the web page or make the nav bar disappear?

Hi. What is site url? We can check problem easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 year later...

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.