News:

Looking for documentation? Take a look on our wiki

Main Menu

Google Adwords Conversion Tracking

Started by jaderotheram, June 28, 2013, 17:38:01 PM

Previous topic - Next topic

romatvirtue

Quote from: Maxim Pishnyak on September 16, 2013, 05:49:23 AM
Quote from: romatvirtue on September 16, 2013, 05:27:06 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

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

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.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

romatvirtue

Quote from: Maxim Pishnyak on September 16, 2013, 05:49:23 AM
Quote from: romatvirtue on September 16, 2013, 05:27:06 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.

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

Quote from: Maxim Pishnyak 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.

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

#20
Quote from: romatvirtue on September 19, 2013, 21:09:11 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

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:

echo "<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";
echo 'YOUR GOOGLE CONVERSION CODE HERE';
echo $this->html;


Should work. Goodluck!

romatvirtue

Quote from: ATek 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:

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

Quote from: romatvirtue on September 26, 2013, 16:02:22 PM
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

Quote from: ATek on September 28, 2013, 06:29:13 AM
Quote from: romatvirtue on September 26, 2013, 16:02:22 PM
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

Quote from: romatvirtue on October 04, 2013, 05:57:36 AM
Quote from: ATek on September 28, 2013, 06:29:13 AM
Quote from: romatvirtue on September 26, 2013, 16:02:22 PM
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

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 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

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:


QuoteTo 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

#28
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

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.