Jump to content

Google Opt In Survey / Reviews


huggettm

Recommended Posts

https://support.google.com/merchants/answer/7106244?hl=en

Trying to add this to CC6, can anyone help.

I need to output this with the values in red from the store, I am unsure how to call them from CC6, also how to output the date as we do not give delivery dates, so it would need to be generated in say 4 days from the date of purchase:

 

*******************************************

<!-- 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
          "opt_in_style": "OPT_IN_STYLE"
        }); 
     });
  }
</script>
<!-- END GCR Opt-in Module Code -->

*******************************************

Link to comment
Share on other sites

{literal}
<!-- 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":"YOUR MERCHANT ID PROVIDED BY GOOGLE",
          "order_id": "{/literal}{$SUM.cart_order_id}{literal}",
          "email": "{/literal}{$SUM.email}{literal}",
          "delivery_country": "{/literal}{$SUM.country_d}{literal}",
          "estimated_delivery_date": "{/literal}{"+2 days"|date_format:"%d-%m-%Y"}{literal}",

          // OPTIONAL
          "opt_in_style": "OPT_IN_STYLE"
        }); 
     });
  }
</script>
<!-- END GCR Opt-in Module Code -->
{/literal}

Try something like this.. the date bit may need work as I haven't tested it. Reference: https://www.smarty.net/forums/viewtopic.php?p=64359

Alternatively you can use JavaScript to get a date x amount of days in the future. The merchant_id is provided by Google right? So you can hard code that value in. 

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...