huggettm

Google Opt In Survey / Reviews

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

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

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

thank you, I have tried adding this to confirmed.inc.php but it doesnt show on a test order,

 

is there another file for the order confirmation page:

storeurl/index.php?_a=complete

 

 

Share this post


Link to post
Share on other sites

Hi Mark,

Sorry for the delay here. I've just been stuck at hospital for a few hours. Nothing important. 

You'll need to add the code to the content.receipt.php file which is the page shown to the customer after payment has been made. 

Share this post


Link to post
Share on other sites

Is it supposed to popup a survey window? Sounds like it. Can you check the console log for any errors? Also check in your Google account if it needs to be turned on or configured at all. 

Share this post


Link to post
Share on other sites

Do Google have any tech support at all? You'd think one of the biggest companies in the world would have staff to help?

Share this post


Link to post
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