Forums / Templates, Stylesheets, Page Layout / How do I put a Google tracking code in my checkout-success file?

How do I put a Google tracking code in my checkout-success file?

Locked
Results 1 to 11 of 11
This thread is locked. New replies are disabled.
01 Mar 2008, 21:57
#1
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

How do I put a Google tracking code in my checkout-success file?

I am inputting Google tracking code into my checkout_success.php file. Where is it safe to input this code? In an html file it woud be anywhere before the /Body tag, but I am not sure with PHP.
02 Mar 2008, 14:39
#2
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

You need to put the tracking code in your tpl_footer page and if you are using one of the mods that call the code, the call needs to come from tpl_main_page.

You can create a goal in analytics to track your success once it starts.

Hope that helps.

Rick
02 Mar 2008, 18:38
#3
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

Thanks, but this doesn't make a lot of sense to me...
02 Mar 2008, 19:43
#4
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

I use Simple Google Analytics from the downloads section for my store.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=412

It requires an sql patch and then there are two files to add. One file goes in your tpl_main_page and the other goes in your tpl_footer.

The directions are easy and simple to follow.

Once installed you can set up goals inside of google analytics to track just about anything you want. I track the checkout success of my store using a goal I setup in google analytics..

Rick
07 Mar 2008, 23:36
#5
tracib avatar

tracib

Zen Follower

Join Date:
Oct 2007
Posts:
157
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

disciple:

It requires an sql patch and then there are two files to add. One file goes in your tpl_main_page and the other goes in your tpl_footer.

The directions are easy and simple to follow.

Once installed you can set up goals inside of google analytics to track just about anything you want. I track the checkout success of my store using a goal I setup in google analytics..

Rick


From my understanding, if you are running version 1.3.X of zen cart, you don't have to past in any code, just upload the included files and install the SQL Patch.

What did you put into your tpl_main_page and tpl_footer files?

I want to set up a goal for checkout success, but can't figure out what the URL would be for that.
23 Mar 2008, 23:36
#6
tech_e avatar

tech_e

Zen Follower

Join Date:
Jan 2007
Posts:
159
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

Are you talking about the Conversion Tracking Code from Google AdWords?

It looks like everyone is talking about Google Analytics.

The Conversion Tracking Code needs to go on a Thank You page or Order Confirmation page that follows an order submission.
24 Mar 2008, 02:07
#7
tracib avatar

tracib

Zen Follower

Join Date:
Oct 2007
Posts:
157
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

Tech-E:

Are you talking about the Conversion Tracking Code from Google AdWords?

It looks like everyone is talking about Google Analytics.

The Conversion Tracking Code needs to go on a Thank You page or Order Confirmation page that follows an order submission.


I'm talking about google analytics as well.

I want to set up a "conversion goal" for when someone makes a purchase--to set up a conversion goal, you are supposed to put in a URL for the page--but I don't know what they URL would be.
25 Mar 2008, 07:12
#8
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Posts:
305
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

I want to add this code as well. It is not the analytics code, I already have that which goes in the footer.

The code kevinmc3 is talking about is also available from google adwords (if you have an account) and is used to track the conversion rate between visits and purchases as well as which product sells the best etc...

It needs to go into the checkout_success page ( or a page the buyer gets to after completing their purchase).

The code is in HTML and we also need to include the following functions:
"Next, somewhere in the receipt below the tracking code, call the _addTrans() and _addItem() functions. Begin with a call to _addTrans() to establish a transaction. _addTrans() takes the following arguments: Order ID,Affiliation, Total, Tax, Shipping, City, State, Country. For each item that the visitor purchases, call _addItem(). _addItem() takes the following arguments: Order ID, SKU or Code, Product Name, Category, Price, Quantity.

Here is a complete example:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();

pageTracker._addTrans(
"1234", // Order ID
"Mountain View", // Affiliation
"11.99", // Total
"1.29", // Tax
"5", // Shipping
"San Jose", // City
"California", // State
"USA" // Country
);

pageTracker._addItem(
"1234", // Order ID
"DD44", // SKU
"T-Shirt", // Product Name
"Green Medium", // Category
"11.99", // Price
"1" // Quantity
);

pageTracker._trackTrans();
</script>"

The above in quotes is from the code instructions on the google adwords page for my account.

If anyone has done this before and can give me an idea of how to go about it, that would be greatly appreciated.

Thank you.
14 Apr 2008, 20:50
#9
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

It requires an sql patch and then there are two files to add. One file goes in your tpl_main_page and the other goes in your tpl_footer.

The directions are easy and simple to follow.

Once installed you can set up goals inside of google analytics to track just about anything you want. I track the checkout success of my store using a goal I setup in google analytics..

Rick[/QUOTE]

You say anything you want. But, what if I want to track visits to the Home Page? Would this require another file or patch?

Same for sign up oage. However, if using a 3rd party email service like Constant Contact, the code would have to go into the Constant Contact Thak You for Siging up page.
30 May 2008, 17:22
#10
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Posts:
293
Plugin Contributions:
8

Re: How do I put a Google tracking code in my checkout-success file?

I took my adwords code from google, created a file called jscript_adwords.php and put that file under the includes/modules/pages/checkout_success folder.

Hope this helps someone who is wanting to know where to put ADWORDS javascript - not the google analytics.
25 Jul 2008, 18:52
#11
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Posts:
476
Plugin Contributions:
0

Re: How do I put a Google tracking code in my checkout-success file?

stellarweb:

I took my adwords code from google, created a file called jscript_adwords.php and put that file under the includes/modules/pages/checkout_success folder.

Hope this helps someone who is wanting to know where to put ADWORDS javascript - not the google analytics.


This method is working perfect for me for Google - I also need to setup MS Adcenter conversion tracking. I'm assuming I can do the same there and a file called jscript_msn-adcenter.php and that will work there also. Is this correct?

Ruth