Author Topic: Add Google Conversion Tracking to Head of Thank you page  (Read 907 times)

adellaguardia

  • Beginner
  • *
  • Posts: 4
  • A beginner
Add Google Conversion Tracking to Head of Thank you page
« on: December 10, 2018, 00:23:06 am »
Hello,
I have been researching this with no resolution. I need to add a piece of Google code to the HEAD of the thank you page for VM to track conversions. I have created the order_done.php file in the template folder as needed for an override, but my script does not appear.
/templates/template_name/html/com_virtuemart/cart/order_done.php

I've added the script by itself above the php code, I've added it using:
$script = "script here";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration( $script );

Nothing seems to work. Do I have to purchase an expensive plugin in order to track conversions? I only need the script on the thank you page in the HEAD section, not on every page.
Can you help?

Joomla 3.9.1
VM 3.4.2
Database Version 10.0.37-MariaDB
PHP Version 5.6.38 (working on getting this updated)
https://hospitalitylamps.com/

StefanSTS

  • Global Moderator
  • Full Member
  • *
  • Posts: 538
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Add Google Conversion Tracking to Head of Thank you page
« Reply #1 on: December 10, 2018, 06:20:41 am »
Hello,

the order_done.php is now called orderdone.php.
Renaming the file should do the job, except you use a One Page Checkout that might use a different orderdone.php in it's own file structure.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

adellaguardia

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: Add Google Conversion Tracking to Head of Thank you page
« Reply #2 on: December 12, 2018, 22:47:43 pm »
That worked, thank you!

depika

  • Beginner
  • *
  • Posts: 46
Re: Add Google Conversion Tracking to Head of Thank you page
« Reply #3 on: December 17, 2018, 15:21:06 pm »
It would be very helpful if you could share the script!! Or at list PM me the code. Thank you in advance