Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 3

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


AmberWhite

Question

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

10 answers to this question

Recommended Posts

  • 0

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
  • 0

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
  • 0

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
  • 0
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.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...