Jump to content

Order Confirmation Page / Google customer reviews opt in

Recommended Posts

So, I'm trying to implement Google customer reviews survey from Google merchant centre. However I have come to realise it won't work without being able to grab a date. 


Is there a way to add Order placed at XXXX-XX-XX with some javascript on the confirmation page? 


The hope is once /if I can add that a date to the page, I can then edit the GCR code to grab that date and add a delay 


GCR code looks something like this but this needs editing

<!-- BEGIN GCR Opt-in Module Code -->
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>// <![CDATA[
var currentTime = new Date()
var day = currentTime.getDate() + 10
var month = currentTime.getMonth() + 1
var year = currentTime.getFullYear()
var final =(year + "/" + month + "/" + day)

  window.renderOptIn = function() {
    window.gapi.load('surveyoptin', function() {
          // REQUIRED FIELDS
          "merchant_id": "****",
          "order_id": "{orderId}",
          "email": "{customerEmailAddress}",
          "delivery_country": "GB",
          "estimated_delivery_date": "final",

Link to comment

If you haven't received an answer yet, you can post on some FB groups
+ Squarespace Customization Resource Groups
+ Squarespace Community
+ Squarespace Entrepreneur
+ Squarespace Rockstars

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

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.