Author Topic: Google opt-in code for reviews  (Read 114 times)

dfumain

  • Beginner
  • *
  • Posts: 1
  • A beginner
Google opt-in code for reviews
« on: March 10, 2018, 16:33:39 pm »
hi all, this has been driving me mad for a good week now, and after looking at googles help and other messages on VM forum im still at a lose.

so im trying to add the google review code to my site, google says it need to be in the The confirmation page..

so ive been reading and after alot of reading. on here most people say it goes in the PHP of this file
components/com_virtuemart/views/cart/tmpl/order_done.php

i have full ftp access and can change all files.
i have added the code in the php and then tested on the site, it stops the cart from working,

my question is have i got some ID wrong

this is the code im adding

<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 FIELDS
          "merchant_id": (i know this number),
          "order_id": "ORDER_ID",
          "email": "CUSTOMER_EMAIL",
          "delivery_country": "COUNTRY_CODE",
          "estimated_delivery_date": "YYYY-MM-DD",

          // OPTIONAL FIELDS
          "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]
        });
    });
  }
</script>

could the order_id be wrong? or any other ID wrong.

if anyone can help this would be great. or point me in the direction of somebody i can pay to help. we are in the UK

im using VM VirtueMart 3.2.12
Joomla! 3.8.5 Stable [ Amani ] 6-February-2018 15:00 GMT

i have full super user account
and the FTP account

im not willing to give out the details, as after reading VM forum some people have been left vulnerable

i can download and send the order php file, and any other files needed, and im quite good following step by step insturctions

please help thank you all