VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: kubi on September 06, 2007, 15:52:09 pm

Title: AdWords Conversion Tracking
Post by: kubi on September 06, 2007, 15:52:09 pm
Hi

I would like to track conversion in my AdWords program. Google tells me that I have to put code snippet in HTML part. But on the last page of order (checkout.thankyou.php) there is only PHP...
I'm not using Google Analytics. Can anybody help me where should I put this Google code?

Kuba
Title: Re: AdWords Conversion Tracking
Post by: kubi on September 10, 2007, 12:01:09 pm
I've put this text at the and of checkout.thankyou.php. Conversion_id is of course not real ;-)

<!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = 100000000;
var google_conversion_language = "pl";
var google_conversion_format = "1";
var google_conversion_color = "000000";
if (<?echo $order_total ?>) {
var google_conversion_value = <? echo $order_total ?>
}
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript"

src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0
src="http://www.googleadservices.com/pagead/conversion/100000000/imp.gif?value=<? echo $order_total ?>&label=purchase&script=0">
</noscript>
Title: Re: AdWords Conversion Tracking
Post by: Datatonic on September 12, 2007, 13:39:59 pm
Correct me if I am wrong but shouldn't this go into the checkout.result.php file?
Title: Re: AdWords Conversion Tracking
Post by: pilotjourney on November 28, 2007, 21:40:33 pm
So where did you finally place the code?
Title: Re: AdWords Conversion Tracking
Post by: r0tt3n on February 19, 2008, 07:57:14 am
I put it on checkout.thankyou.php....  Should know if it worked ok in about 24 hours.... great work Kubi on finding all the places to insert the order_total....  excellent! 
Title: Re: AdWords Conversion Tracking
Post by: r0tt3n on February 19, 2008, 08:36:03 am
Has anyone actually gotten this to work?  I'm having trouble because $order_total doesn't appear to be a variable that is recognized by the thankyou page.  I tried putting global $order_total near the beginning of the page, but it's not working, and nothing is being echoed, which is breaking the script and having it report nothing.  If anyone could help, that would be swell.
Title: Re: AdWords Conversion Tracking
Post by: kubi on February 21, 2008, 20:29:10 pm
Hey, it's me again ;-). Paste it at the same end of checkout.thankyou.php. Change conversion_id and language of course ;-).

<!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = 100000000000;
var google_conversion_language = "pl";
var google_conversion_format = "2";
var google_conversion_color = "FFFFFF";
<?php $total = $db->f("order_total"); ?>
if (<?php echo $total ?>) {
var google_conversion_value = <? echo $total ?>
}
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0
src="http://www.googleadservices.com/pagead/conversion/1060552975/imp.gif?value=<? echo $total ?>&label=purchase&script=0">
</noscript>
Title: Re: AdWords Conversion Tracking
Post by: blscott on March 14, 2008, 01:02:46 am
Did you guys actually make the conversion code work?  If so, where exactly did you place it on the checkout.thankyou.php?

Thanks
Title: Re: AdWords Conversion Tracking
Post by: Xaman on March 22, 2008, 17:02:20 pm
Anyone knows which is the file to include the code to confirm registrations?
Title: Re: AdWords Conversion Tracking
Post by: hero on March 22, 2008, 17:10:11 pm
come again ?
you go to your adwords account and activate track conversions..
but I don't know if you can enter the code as such, as this is a pure HTML code.
Title: Re: AdWords Conversion Tracking
Post by: hero on March 22, 2008, 18:39:25 pm
I added the Google tracking and I added to each line echo ' .... ' ;

now wait a few hours and I will check if this worked..
Title: Re: AdWords Conversion Tracking
Post by: BradM on July 02, 2008, 20:20:09 pm
Anyone ever figure this out? It's INSANE that this software doesn't have an easy option to add this.
Title: Re: AdWords Conversion Tracking
Post by: jschafer52 on August 15, 2008, 00:05:52 am
anyone get this to work yet?
Title: Re: AdWords Conversion Tracking
Post by: teratyke on September 20, 2008, 15:00:50 pm
I've appended the Google Conversion Tracking code to checkout.thankyou AND checkout.result. Neither is generating Google conversions for me. However adding the code to the end of the registration page does work (for showing registrations not sales conversions)
Maybe its because my customers aren't returning to my site after completing payment (I'm redirecting them to PayPal). So to answer the above question - "has anyone got this to work yet?", well for me no.
Rob
j1.5.7 vm 1.1.2
Title: Re: AdWords Conversion Tracking
Post by: Gary on September 20, 2008, 21:05:55 pm
I need to set up conversion tracking and would REALLY appreciate it if someone could suggest a method that WORKS as we have already wasted a couple of hundred pounds on Adwords and NEED to find out whats going on!!!

Thanks

Gary
Title: Re: AdWords Conversion Tracking
Post by: Gary on September 25, 2008, 12:29:05 pm
I am really fed up with Virtuemart now. The forum is practically dead.

I understand the whole community thing, but when you put days, weeks and months into something and then hit a hurdle that you cant overcome, its really annoying :(

I have a company managing our adwords campaigns, its costing us money, yet we cant track what sales comes through adwords.

Is there a way to track CONVERSIONS that ACTUALLY works???

Thanks to anyone that bothers to reply.....

Gary
Title: Re: AdWords Conversion Tracking
Post by: Michael on October 03, 2009, 14:40:47 pm
Looks like the problem people are having is adding code to the ADMINISTRATOR file via the rool level...proper place is here.
http://www.serr.biz/virtuemart-1-1-2-seo-cart/google-adwords-tracking-code-virtuemart.html
Title: Re: AdWords Conversion Tracking
Post by: whoartnow on September 09, 2010, 17:45:32 pm
Right - this guy has got the answer:

http://www.serr.biz/virtuemart-1-1-2-seo-cart/google-adwords-tracking-code-virtuemart.html

Via FTP, open components > virtuemart > themes > default > templates > pages > checkout.thankyou.tpl.php
*Having reviewed the forums myself, it seems some people have been adding the code to the same page, but in the ADMINSTRATOR folder. That is where there mistake lay. DO NOT add the code to the ADMINISTRATOR file.
At the end of the code, just add your Google Conversion Tracking code.

just implemented the whole thing in 5 mins, & tested it, and Bingo!! it works ;)
Title: Re: AdWords Conversion Tracking
Post by: kbrookes on September 11, 2010, 09:00:43 am
Can you please post the code you used? I think I'm having issues figuring out which variables should be used.

I'm using the OpenPotion analytics plugin, which supports the asynchronous snippet. I'm also using the asynchronous version of the ecommerce code. It should be working, but it's eluding me so far.
Title: Re: AdWords Conversion Tracking
Post by: misholini on November 12, 2013, 18:31:37 pm
I've put this text at the and of checkout.thankyou.php. Conversion_id is of course not real ;-)

<!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = 100000000;
var google_conversion_language = "pl";
var google_conversion_format = "1";
var google_conversion_color = "000000";
if (<?echo $order_total ?>) {
var google_conversion_value = <? echo $order_total ?>
}
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript"

src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0
src="http://www.googleadservices.com/pagead/conversion/100000000/imp.gif?value=<? echo $order_total ?>&label=purchase&script=0">
</noscript>
Any suggestions how to Echo the Order total? The above suggestion does not work and Google Tag Assistant report an error with the code above.