Author Topic: Google Adwords Conversion Tracking  (Read 27005 times)

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Re: Google Adwords Conversion Tracking
« Reply #15 on: September 16, 2013, 06:25:19 am »
1. I don't have a direct URL for the tracking as you have to sign in to your account to be able to generate the code. I am talking about facebook ad. So you have to create an add in your account and then they will give you a conversion tracking script.

2. As far as my website URL, you won't see if the code is loading unless you go through the checkout process. The reason is that it's inserted in order_done file.
1. I'm able to signup. Just give me the url. Also you could probably gather urls for tracking code instructions, can you?
2. Could you create copy of your website elsewhere with accessible for me checkout? Renew tracking codes for this place probably.

Max, the facebook URL is this: https://www.facebook.com/ads/manage/convtrack.php?act=xxxxxxxxxxxxxxx. You would need to replace xxxxxxs with your account id. This is a facebook page.

As far as URL for the site, I'll send you the link in a moment. I turned on Sandbox for you to try if you wish. Once again, I appreciate all your help. Thanks.

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Re: Google Adwords Conversion Tracking
« Reply #16 on: September 19, 2013, 21:09:11 pm »
Can someone else please help with this? How do I properly insert a conversion tracking JavaScript code into order confirmation page (order_done.php)? I am really surprised no one has done it, or doesn't know how to do it. VM is an E-Commerce platform. Don't you advertise with AdWords or Facebook or some other companies?

Please assist.

Thank you very much in advance.

Maxim Pishnyak

  • Virtuemart 2 is quite bugfree now
  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
  • Virtuemart 2 is quite bugfree now
    • Virtuemart Ukraine division
Re: Google Adwords Conversion Tracking
« Reply #17 on: September 22, 2013, 11:46:27 am »
Could you install a copy of your website somewhere (on subdomain etc).

You and me could make some test in a safe place with your test products.
Virtuemart 2 is quite bugfree now. You can support Community by voting for Project on the JED
http://extensions.joomla.org/extensions/e-commerce/shopping-cart/129/review
Join us in
https://www.facebook.com/virtuemart
https://twitter.com/virtuemart

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Re: Google Adwords Conversion Tracking
« Reply #18 on: September 23, 2013, 20:14:54 pm »
1. I don't have a direct URL for the tracking as you have to sign in to your account to be able to generate the code. I am talking about facebook ad. So you have to create an add in your account and then they will give you a conversion tracking script.

2. As far as my website URL, you won't see if the code is loading unless you go through the checkout process. The reason is that it's inserted in order_done file.
1. I'm able to signup. Just give me the url. Also you could probably gather urls for tracking code instructions, can you?
2. Could you create copy of your website elsewhere with accessible for me checkout? Renew tracking codes for this place probably.

Hi Max. I sure can. I will do that and let you know once it's accessible. Just to let you know, I think the code is inserted properly. However, it's not capturing order information and that's why there is no conversion being tracked...

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Re: Google Adwords Conversion Tracking
« Reply #19 on: September 25, 2013, 00:22:49 am »
Could you install a copy of your website somewhere (on subdomain etc).

You and me could make some test in a safe place with your test products.

Hi Max, please use the credentials you got from the registration and try to buy the product. You should have no problem now. Again, the script load fine, but no conversion is being tracked. I am assuming it's because no product related info is loaded at the checkout.

Thank you.

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3353
  • using Matomo instead of Google Analytics
Re: Google Adwords Conversion Tracking
« Reply #20 on: September 25, 2013, 21:05:10 pm »
...I am really surprised no one has done it, or doesn't know how to do it. VM is an E-Commerce platform. Don't you advertise with AdWords or Facebook or some other companies?
Just in case you guys don't succeed, you might consider to use the free "Piwik" + free "Piwik plugin for VirtueMart" instead of Google Analytics. It allows to use conversion tracking, which is not limited to Google adwords. And it collects data in your own database instead of feeding Google databases - if you care about data privacy.

And no - I don't use AdWords (Instead I invest some time into free SEO) or Facebook for advertising. The fact that the majority of businesses invest a lot of time into facebook pages doesn't mean it's profitable.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

ATek

  • Beginner
  • *
  • Posts: 5
Re: Google Adwords Conversion Tracking
« Reply #21 on: September 26, 2013, 09:47:02 am »
To answer the original poster's question.

Put a file on your website here -> /templates/Your Template/html/com_virtuemart/cart/order_done.php

The file to put above you should just copy file from components/com_virtuemart/views/cart/tmpl/order_done.php

Copy and past the Google Adwords Conversion code like this:
Code: [Select]
echo "<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";
echo 'YOUR GOOGLE CONVERSION CODE HERE';
echo $this->html;

Should work. Goodluck!

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Re: Google Adwords Conversion Tracking
« Reply #22 on: September 26, 2013, 16:02:22 pm »
To answer the original poster's question.

Put a file on your website here -> /templates/Your Template/html/com_virtuemart/cart/order_done.php

The file to put above you should just copy file from components/com_virtuemart/views/cart/tmpl/order_done.php

Copy and past the Google Adwords Conversion code like this:
Code: [Select]
echo "<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";
echo 'YOUR GOOGLE CONVERSION CODE HERE';
echo $this->html;

Should work. Goodluck!

Hi there. I appreciate you taking time to reply. That's exactly how I have inserted it. However, my client claims nothing is being captured...:(

ATek

  • Beginner
  • *
  • Posts: 5
Re: Google Adwords Conversion Tracking
« Reply #23 on: September 28, 2013, 06:29:13 am »
Hi there. I appreciate you taking time to reply. That's exactly how I have inserted it. However, my client claims nothing is being captured...:(
Maybe there is a problem with your override not working or the wrong folder.  Try editing both the original file and the override and see if anything changes.

When I pause the page right before it redirects to Paypal I can click view page source in Firefox and see the snippet of google code on the page.

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Re: Google Adwords Conversion Tracking
« Reply #24 on: October 04, 2013, 05:57:36 am »
Hi there. I appreciate you taking time to reply. That's exactly how I have inserted it. However, my client claims nothing is being captured...:(
Maybe there is a problem with your override not working or the wrong folder.  Try editing both the original file and the override and see if anything changes.

When I pause the page right before it redirects to Paypal I can click view page source in Firefox and see the snippet of google code on the page.

Gotcha. Well, we use gateway. So on the confirmation page, I can see the code being loaded. Usually that means I did it right. Does this mean my client isn't properly testing it or something?

Thanks.

ATek

  • Beginner
  • *
  • Posts: 5
Re: Google Adwords Conversion Tracking
« Reply #25 on: October 10, 2013, 00:22:06 am »
Hi there. I appreciate you taking time to reply. That's exactly how I have inserted it. However, my client claims nothing is being captured...:(
Maybe there is a problem with your override not working or the wrong folder.  Try editing both the original file and the override and see if anything changes.

When I pause the page right before it redirects to Paypal I can click view page source in Firefox and see the snippet of google code on the page.

Gotcha. Well, we use gateway. So on the confirmation page, I can see the code being loaded. Usually that means I did it right. Does this mean my client isn't properly testing it or something?

Thanks.

If you can see the code being loaded I would imagine it is working properly and Google should be confirming conversions, which you can confirm in your google adwords account.  You can test this easily by doing a mock product purchase and see whether the conversion is "reporting" after 15 minutes or so.  Unfortunately this is the extent of my knowledge on the process.

logobis

  • Beginner
  • *
  • Posts: 19
Re: Google Adwords Conversion Tracking
« Reply #26 on: November 28, 2013, 14:37:05 pm »
Hi,

I'm user of Google ADWORDS and I confirm that the code should be implement in order_done.php (templates/YOUR_TEMPLATE/html/com_virtuemart/cart/order_done.php). IN my case, it's works perfectly even with 4 kinds of payments-> Paypal, Credit Card (ATOS), Check and Bank Transfer.
My Question here is how to improve the google code.

This line
Code: [Select]
var google_conversion_value = 0; is to catch the order total amount of the transaction for ADWORDS analytics (and of course, improvement of your ROI....:)). Instead of "0" you'll have to put the value of the order.But I don't know how I could find the value (order total).Something like $this->order-total....???
Thank's for your help....

microtribe

  • Beginner
  • *
  • Posts: 39
Re: Google Adwords Conversion Tracking
« Reply #27 on: December 28, 2013, 01:40:35 am »
Logobis - Did you change the code based on Google's instructions for adding the conversion code to a php page? See below where I've copied in their instructions:


Quote
To add conversion tracking code to PHP pages using your web page editor, look to the code below, then remove from your own code the lines that are crossed out, and manually add the areas that are highlighted

      
  <!-- Google Code for Purchase Conversion Page -->
  <script type="text/javascript">
  /* <![CDATA[ */
  var google_conversion_id = 1234567890;
  var google_conversion_language = "en_US";
  var google_conversion_format = "1";
  var google_conversion_color = "666666";
  var google_conversion_label = "Purchase";
  var google_conversion_value = 10;
  if (<? echo $totalValue ?>) {
  var google_conversion_value = <? echo $totalValue ?>
  }
  /* ]]> */
  </script>
  <script type="text/javascript"
  src="//www.googleadservices.com/pagead/conversion.js">
  </script>
  <noscript>
  <img height=1 width=1 border=0
  src="//www.googleadservices.com/pagead/
  conversion/1234567890/?value=
  <? echo $totalValue ?>&label=Purchase&script=0">
  </noscript>
  </body>
Open your conversion confirmation page PHP file. If multiple pages are generated from the same file, find the section in the PHP file which generates your conversion page.
If your site has a variable conversion value, determine the PHP expression that displays that value. For example: <?php echo $totalValue ?>, <? echo totalValue ?>
Choose the Purchase/Sale conversion type while going through the conversion tracking setup.
Enter a default numeric value in the “Conversion value” field, then replace the line “var google_conversion_value = …” manually with the following
  if (<%= totalValue %) {
   var google_conversion_value = <%= totalValue %>;
   }
You’ll also need to add replace the default numeric value with “<%= totalValue%>” in the <noscript> section of the tag highlighted above.
Copy and save the resulting code snippet.
Insert the conversion tracking code onto the conversion confirmation page. Make sure that the code appears within a static HTML section, not contained within an PHP code section (delineated by <? and ?> markers). As you insert the code snippet, make sure you place it directly into the body of the conversion confirmation page. To make sure you do, search for the </body> tag and place the code immediately above it. Or, if the </body> tag is not located within the static portion of the HTML page, make sure that you add the code snippet so that it appears within the <body> section of the page as shown below.
Save your conversion confirmation file and upload to your web server if necessary. If you'd like to test the placement of your conversion tracking code, go to your conversion page by completing a conversion on your site. View the source of the page (in Internet Explorer choose View > View Source). You should see the conversion tracking code between the <body> and </body> tags on your page. Note that the PHP expression will be replaced by the actual conversion value when you view the source.

Peter Pillen

  • Jr. Member
  • **
  • Posts: 223
Re: Google Adwords Conversion Tracking
« Reply #28 on: March 21, 2014, 16:30:59 pm »
The file you need to change = components/com_virtuemart/views/cart/tmpl/order_done.php = thank you page after placing an order.

The code you need to add is the code you get from Google ... with two little changes to add the conversion value

var google_conversion_value = <?php echo $this->cart->pricesUnformatted['billTotal'] ?>;

and in the img src url ...?value=<?php echo $this->cart->pricesUnformatted['billTotal'] ?>....

Tip:
If you want to see which other values you can use, just write print_r($this->cart->pricesUnformatted); in the order_done file and you will see all other values you can use. Don't leave your file like that of course... otherwise customers wil get scared LOL

Also remember that it can take some time between the conversion itslef and the time you see in your Adwords account. But mine is working as it should now.

EDIT: components\com_virtuemart\views\pluginresponse\tmp l\default.php also needs to be adapted with the tracking code.

oviliz

  • Beginner
  • *
  • Posts: 27
Re: Google Adwords Conversion Tracking
« Reply #29 on: July 14, 2014, 12:24:08 pm »
Gi Peter, can you please provide more details?

I made added the AdWords code at the end of my:
components/com_virtuemart/views/cart/tmpl/order_done.php
and
components\com_virtuemart\views\pluginresponse\tmp l\default.php

From the AdWords code, specific to my account, I changed only:
var google_conversion_value = 1.00;
with
var google_conversion_value = <?php echo $this->cart->pricesUnformatted['billTotal'] ?>;

I don't understand well the (same?) code about IMG src.

Anyway after that change the visitors confirmation orders are redirected to a blank cart/confirm.php page.