News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

help with google opt in code for reviews on website

Started by dfumain, March 13, 2018, 22:41:41 PM

Previous topic - Next topic

dfumain

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

Ghost

You're saying the order ID could be wrong but you don't show how you get the ID?

Austin Walker

#2
--

dfumain

hi, im just taking it as ORDER_ID will be the same, in the virtual mart settings, or would this me called a different name, and thats what i have over looked

Ghost

ORDER_ID is nothing. It's a placeholder text. You're supposed to get the actual ID from VM. Same with other fields.

dfumain

can anyone help please? or point me in the right directions thanks

Jumbo!

components/com_virtuemart/views/cart/tmpl/order_done.php is not the final order confirmation page layout for all payment plugins. If you use hosted payment services like Authorize.net, Standard Payment etc then the order confirmation page is displayed using components/com_virtuemart/views/cart/tmpl/order_done.php But if you use any payment services like PayPal Standard, 2Checkout etc then the order confirmation is displayed using components/com_virtuemart/views/vmplg/tmpl/default.php

Most importantly, the contents displayed in these pages are controlled by the selected payment plugin. You do not have the actual order information in the layout files which you can pass to your opt-in tracking codes. Therefore you will have to override the respective payment plugin's order confirmation page layout to properly pass the order information to your opt-in tracking codes. For example, Standard Payment uses this layout file to print the order confirmation - plugins/vmpayment/standard/standard/tmpl/post_payment.php

We have developed a plugin to avoid this problem. It can easily add any kind of tracking/opt-in codes to the final order confirmation without getting into any kind of coding or layout overrides. You can take a look at VP Conversion Tracking plugin - https://www.virtueplanet.com/extensions/vp-conversion-tracking It will help you to easily setup the Google Opt In codes to your order confirmation page right from the plugin settings.

MAD King

Quote from: Jumbo! on April 02, 2018, 15:35:06 PM

We have developed a plugin to avoid this problem. It can easily add any kind of tracking/opt-in codes to the final order confirmation without getting into any kind of coding or layout overrides. You can take a look at VP Conversion Tracking plugin - https://www.virtueplanet.com/extensions/vp-conversion-tracking It will help you to easily setup the Google Opt In codes to your order confirmation page right from the plugin settings.

You are my man, Jumbo. Thank you.
Joomla! 4.3.4
VirtueMart 4.2.4 10922

Jumbo!

Quote from: MAD King on January 25, 2020, 17:29:37 PM
Quote from: Jumbo! on April 02, 2018, 15:35:06 PM

We have developed a plugin to avoid this problem. It can easily add any kind of tracking/opt-in codes to the final order confirmation without getting into any kind of coding or layout overrides. You can take a look at VP Conversion Tracking plugin - https://www.virtueplanet.com/extensions/vp-conversion-tracking It will help you to easily setup the Google Opt In codes to your order confirmation page right from the plugin settings.

You are my man, Jumbo. Thank you.

You are welcome. :)