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.
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.
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
Thanks, but this doesn't make a lot of sense to me...
I use Simple Google Analytics from the downloads section for my store.
http://www.zen-cart.com/index.php?ma...roducts_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
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.
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 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.
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.
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.