google ad words conversion tracking code

Support desk for Multipurpose Quark Theme
GK User
Thu Mar 31, 2016 6:27 pm
12/3 quick install quark ecommerce
www.ahgoobaby.com

Where should I put the google adwords tracking code so that I can track purchase conversions on this template using virtuemart? Please let me know any recommendations on how to get this best to work when a customer makes a PURCHASE from the cart.
User avatar
Expert Boarder

GK User
Thu Mar 31, 2016 7:22 pm
I am not sure but could it be in "order_done.php" found in: /templates/gk_quark/html/com_virtuemart/cart?

See: https://support.google.com/adwords/answer/6095947?hl=en&authuser=0 Part 3 in instructions. They advise the page you put the code snippet on is the one your customer sees after a conversion (or in my case a purchase". When inserting the tag, you'll place it on the static portion of the page, found within the <body> section.

Please confirm the above referenced page is the correct page to to do that and if so WHERE I should put that tracking code specifically so as not to break any of the site's function. If this is NOT the correct page to put this code, please refer me to the correct page that the customer would see after making a purchase.
User avatar
Expert Boarder

teitbite
Mon Apr 04, 2016 12:55 pm
Hi

I'm sorry, but I do not know an answer to this question. You should ask VM support. I'm not VM expert, so I cannot tell which files are used during purchase completion.
User avatar
Moderator

GK User
Tue Apr 05, 2016 4:38 pm
Well for those of you using an eccomerce website with virtuemart wanting to use adwords (I presume that is going to be a large % of those users, here is the fix that I was able to get working with Google's tech support. Note that this is the correct conversion location to use with any similar service like an affiliate service which tracks conversions from the point the customer actually confirms the checkout process and / or pays. Here is the specific fix for google ad words:

Find the standard.php file in the following directory:
/plugins/vmpayment/standard


edit the file standard.php

find the following text:

$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);


directly below this line add your tracking pixel / snippet. As an example, for google adwords the code would be as follows:

$html .= 'alt="" src="//www.googleadservices.com/pagead/conversion/xxxx/?value='.$order['details']['BT']->order_subtotal.'&currency_code=USD&label=yyy&guid=ON&script=0"/>';

the above code is the code forumla where xxx and yyy above need to be replaced with custom information that is unique to your google adwords account. Specifically:

"xxx" would be your own unique adwords account conversion ID
"yyy" after &currency_code=USD&label= would be your own unique adwords conversion label

To find your own unique information to replace in the above conversion ID and conversion label, go to your adwords account online and click TOOLS/CONVERSION

Then click on the conversion you have created that you want to track as your adwords conversion. Inside the uniqu box google gives you for your conversion snippet that contains the above 2 unique elements to add to the above code in standard.php. Make the respective replacements and upload the amended standard.php file back to your site and your conversions should be working ok. If you want to double check you can call google adwords tech support (this is a USA number so not sure if it works outside of the usa): 866-246-6453 and they will test your site for you to confirm the snippet is firing correctly.
User avatar
Expert Boarder

GK User
Wed Jul 27, 2016 3:22 pm
After more depth of testing, I have discovered that although this fix does work for COD and some other stock payment methods, not all VM3 payment methods fire the same way. If you are using the VM stock paypal payment method - in particular in association with a paypal payment pro account for your site, this fix will not work. I did find a plugin from virtueplanet that works well for google adwords, google analytics (including ecommerce plus), and has a section for affiliate tracking pixels which allows you to add as many of these as you wish. It is expensive but works and anyone interested in more details where the above fix did not work for them can PM me as I tend to prefer not to advertise in these - only to offer lessons learned.
User avatar
Expert Boarder

teitbite
Mon Aug 01, 2016 5:00 pm
Hi

Thank You for this detailed explanation. I'm sure someone will benefit from it. Unfortunately I need to close this thread since it's not related with our products.
User avatar
Moderator


cron