Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Google Adwords Conversion Tracking: a how-to on adding code

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 05-19-2006, 03:49 PM
  markcrobinson's Avatar 
markcrobinson markcrobinson is offline
 

Senior Member
  
Join Date: Jan 2006
Posts: 180
 

Default message.tpl page

I realize that this is the page where we put code for conversion tracking, but It appears that Google Analytics needs a URL that is accessed at the end of an order... I don't think Analytics wants any code to be placed on the page like conversion tracker.


http://www.handicappedpets.com/xcart/customer/main/order_message.tpl
is not a valid URL.

I understand that the messagl.tpl page is the template for the receipt page - and it looks like the url for the receipt page changes with every order.... which leaves the Thank you page.
---------------------------------------------
Further research: Analytics does require code on the page and the URL pf the page (with the code on it) that is the "Goal" soooo, I need to find the temlpate that creates the Thank You page and put the code on that.
DO you know where that page gets created?
__________________
X-Cart version 4.4.5
PHP 5.1.6
GD bundled (2.0.28 compatible)
MySQL server 5.0.45
MySQL client 5.0.45
Web server Apache/2.2.3 (CentOS)
Operation system Linux
Perl not found
XML parser (expat) found
X-Cart directory size 316 Mb
Reply With Quote
  #22  
Old 05-20-2006, 06:02 AM
 
metinex metinex is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 82
 

Default

Your post is great help.

It looks we let Google know about every sales on our web site. How can we accomplish to run this snippets only when the customer really comes from Google ads? Probably we need to check some values in cookies. What cookies Google use?

By the way, I would create two different .tpl file for your two snippets as they can be used many times in different pages.

and would call them like this:
<include file="file1.tpl" conversion="1">
<include file="file2.tpl" type="Purchase"> whereever I need

change in file1.tpl
var google_conversion_format = "$conversion";

change in file2.tpl
__________________
Jay S

Xcart 4.1.3 & Mysql 5.0.20
Xcart 4.0.17 & Mysql 4.1
Apache 2.0 & Linux Whitebox 3
Reply With Quote
  #23  
Old 05-20-2006, 12:26 PM
 
metinex metinex is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 82
 

Default

Answer to my own question:

Actually there is no need to check cookies. If I put GET parameter into link in Adwords advertisement. That would enough for me to use it in the template using $smart.get
__________________
Jay S

Xcart 4.1.3 & Mysql 5.0.20
Xcart 4.0.17 & Mysql 4.1
Apache 2.0 & Linux Whitebox 3
Reply With Quote
  #24  
Old 05-20-2006, 11:44 PM
 
patrick24601 patrick24601 is offline
 

Senior Member
  
Join Date: Mar 2006
Location: Oklahoma City, OK
Posts: 183
 

Default

If you use Google Adwords and Google Analytics it already know which ones came from Adwords ads. It is built in - Both in the adwords and the analytics side. I get instant reporting on my advertising ROI.
__________________
---
Patrick Allmond
Xcart 4.0.18
Now on a dedicated linux box
Reply With Quote
  #25  
Old 10-19-2006, 11:02 PM
 
TL408 TL408 is offline
 

X-Adept
  
Join Date: Jan 2005
Posts: 549
 

Default Re: Google Adwords Conversion Tracking: a how-to on adding code

Has anyone able to get this tested on the X-cart 4.1.X platform yet?

Thanks
-Tuan
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9
Reply With Quote
  #26  
Old 06-29-2007, 03:34 PM
 
economedical economedical is offline
 

Advanced Member
  
Join Date: Feb 2005
Location: Sydney Australia
Posts: 77
 

Default Re: Google Adwords Conversion Tracking: a how-to on adding code

Sorry to revive an old thread but there are still some unanswered questions for me and others. Since this is a 'completed mod' I think it should be cleared up on whether people have it working and what exactly works.

The code supplied by google to us for the second part is noticably different to what is posted here in the thread. I highlighted what I thought was the most relevant difference. I also noted that the other examples of code use the [img][/img] tags instead of the code I have used with the reference to imp.gif - is this the problem?
Code:
{literal} <script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <img height=1 width=1 border=0 src="https://www.googleadservices.com/pagead/conversion/XXXXXXXXX/imp.gif?value=1.0&label=purchase&script=0"> </noscript> {/literal}

I first added the code as supplied by google to the places mentioned at the beginning of this thread. On the final page (order_message.tpl), I got a smarty error at the point I assumed the google message/link was supposed to appear. I then reviewed the code here and added the '{literal}' tags to either side of both bits of code. Now I do not get a smarty error but I also don't see the google link that is supposed to be there on the purchase confirmed page, so I am assuming conversion tracking is not working yet. Anyone have any help or ideas? Would be greatly appreciated. I am a PHP/XCart noob by the way, which may well be apparent.....
__________________
x-cart 4.6.4 RB3 (mystethoscopeshop.com(.au))
x-cart 4.5.0 (4.6.4 RB3 in dev) (economedical.com.au)
ReBoot V3 (great xcartmod)
Big ups to bcsengineering.com great mods excellent support. Also shout out to xcartmods.co.uk, Firetank and alteredcart.com easy add ons for x-cart makes stores look great with minimal fuss.
Reply With Quote
  #27  
Old 07-25-2007, 02:43 PM
 
jdos jdos is offline
 

Newbie
  
Join Date: Sep 2006
Posts: 4
 

Default Re: Google Adwords Conversion Tracking: a how-to on adding code

I keep getting file operation is failed. I've just been going into my admin and going to the template locally. Im pretty new with this stuff anyone know what I might be doing wrong?
__________________
4.0
Reply With Quote
  #28  
Old 10-02-2007, 05:27 PM
 
starwest starwest is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 268
 

Default Re: Google Adwords Conversion Tracking: a how-to on adding code

In 4.1.x I had to use the following for step #7 of the original post, instead of what is posted:

Code:
<script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <img height=1 width=1 border=0 src="https://www.googleadservices.com/pagead/conversion/PUT-YOUR-CONVERSION-ID-HERE/imp.gif?value={$order.subtotal}&label=purchase&script=0"> </noscript>

Without changing the code, the value didn't actually show the order subtotal, it was just blank.
__________________
X-Cart Gold v4.1.10 [unix]
AOM, Special Offers, CDSEO Pro, Remember Anon Carts, Back-In-Stock Notifications, MM3, Feed Manager
Reply With Quote
  #29  
Old 10-29-2007, 02:00 PM
 
ozchris ozchris is offline
 

Senior Member
  
Join Date: Jun 2007
Posts: 100
 

Default Re: Google Adwords Conversion Tracking: a how-to on adding code

I have to agree that the Google integration on 4.1.8 is not at all straightforward.

I had problems putting the analytics code in - the input screen kept blanking out the code when i pasted it in, and the actual call was missing from the bottom of the template, so I ended up hardcoding it into the template.

And with the adwords code, as economedical, i was getting a smarty error.

And the code that adwords provides assumes a $1 conversion value, unless you read the help page, which suggests using your total value field.

I ended up pasting this code:

<!-- Google Code for purchase Conversion Page -->
{literal}
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = xxxxxx;
var google_conversion_language = "en_AU";
var google_conversion_format = "1";
var google_conversion_color = "FFFFFF";
if ({/literal}{$full_subtotal}{literal}) {
var google_conversion_value = {/literal}{$full_subtotal}{literal};
}
var google_conversion_label = "purchase";
//-->
</script>
{/literal}
<script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0 src="https://www.googleadservices.com/pagead/conversion/xxxxxxxx/imp.gif?value={$full_subtotal}&label=purchase&scri pt=0">
</noscript>


copied from this thread http://forum.x-cart.com/showthread.php?t=33607&page=2&highlight=adwords+tr acking, but in testing on xampp, i am not getting the displayed google code.

will let you know what happens in prod.

(also using aud currency)
__________________
Linux. Apache. PHP 5.2
Site 1 - now xcart 4.4.1 DSEFU, AOM, RMA, Magnifier, Upsells. Heavy mods for Australian postcode validation and extra Aussie payment method.
Site 2 - xcart 4.1.11, DSEFU
Site 3 - xcart 4.2
Site 4 - xcart 4.3
Reply With Quote
  #30  
Old 10-30-2007, 01:35 AM
 
economedical economedical is offline
 

Advanced Member
  
Join Date: Feb 2005
Location: Sydney Australia
Posts: 77
 

Default Re: Google Adwords Conversion Tracking: a how-to on adding code

Yeh let me know how it goes ozchris - still keen to know how it turns out.

Also to update - conversion tracking is now working - just no google link as stated previously.
__________________
x-cart 4.6.4 RB3 (mystethoscopeshop.com(.au))
x-cart 4.5.0 (4.6.4 RB3 in dev) (economedical.com.au)
ReBoot V3 (great xcartmod)
Big ups to bcsengineering.com great mods excellent support. Also shout out to xcartmods.co.uk, Firetank and alteredcart.com easy add ons for x-cart makes stores look great with minimal fuss.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:09 AM.

   

 
X-Cart forums © 2001-2020