I tried this already, had no luck :huh:
Printable View
I tried this already, had no luck :huh:
Ok, I've finally got the e-commerce working, but I have another problem.
In my tracking code, I have two instances of the GA tracking code, which is causing my statistics to show an inflated hit count and an abnormally low bounce rate.
I look at the code in tpl_main_page.php and find one instance of the GA code and upon checkout, Zencart is adding an extra instance of the GA code.
How do I fix this?
Here is the relevant code:
HTML Code:<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">
try {
var pageTracker = _gat._getTracker("UA-6204079-3");
pageTracker._trackPageview();
} catch(err) {}</script>
<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-6204079-3");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._addTrans(
"148",
"",
"56.91",
"3.86",
"8.95",
"Riverside",
"California",
"United States"
);
pageTracker._addItem(
"148",
"5",
"IT203 ISCAlure-Citrella<br> for citrus leafminer",
"Lures",
"4.41",
"10"
);
pageTracker._trackTrans();</script><!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = 1940015892;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "FFFFFF";
if (56.91) {
var google_conversion_value = 56.91;
}
var google_conversion_label = "purchase";
//-->
</script>
<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/1940015892/?value=56.91&label=purchase&script=0">
</noscript>
</body></html>
Here is the code from tpl_main_page.php:
HTML Code:<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">
try {
var pageTracker = _gat._getTracker("UA-6204079-3");
pageTracker._trackPageview();
} catch(err) {}</script>
<?php
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');
?>
All zen cart installs have the "tpl_main_page.php" file located in the /common folder of the "template_default" directory.
If you are using a custom template with a different directory you should utilize the overrides that zen cart provides.
Copy the "tpl_main_page.php" from the "template_default" directory to your /common folder in your custom directory and add the line of code indicated in the installation instructions for the Google Mod.
Should work if you do that. If you can't see the code you either did not copy it into your template file or did not include that "tpl_main_page.php" file in the proper location of the template you are using.
Hope that helps.
The only way there can be two instances of the tracking code is if you or someone else hand entered it into the page in question (maybe in the footer file?)
You'll need to remove the hand entered version from every page it is on and only leave the version I have in my mod here.
The duplicate tracking code us typically a result of the hand entered code 99.9% of the time. Once you find where the "added code" is (again, check the footer file as a possible area where most people try to hand enter it all) and remove it, you'll be ok.
What's the best way to track referrals in Analytics using a url parameter? Such as:
www.domain.com/?referrer=emaillink
www.domain.com/?referrer=bbforum
The issue is 7% of my visitors are "direct" traffic, ie: no known referrer, so they're clicking on my email links or copying and pasting the url or typing it in, and I want to find out which.
I'm running a patched 1.3.7 cart and I've added in this Simple Google Analytics.
We have a web site with several pages of product and company information and then we have a store. You can get to the store from many of our pages and we'd like to know which ones are the best.
(These are not real URLs. Don't click on them.)
our website is www.oursite.com and the store's index.php is www.oursite.com/inner/store/
We have people come to www.oursite.com/inner - navigate around and then go to the store.
The code shows on my pages and google shows the traffic so I believe it's all working. BUT...
When we use Analytics, traffic to www.oursite.com/inner/store is all direct! If we look at Analytics' "Top Landing Pages" www.oursite.com/inner/store is one of them. But no one goes directly to our store that way.
How do I know? Because inner can only be accessed directly (there are no links) and it's never been published. All of the traffic is our test traffic.
Any ideas?
Hello, Zenners .. not sure if we have a common problem or a situation unique to our set-up, but we haven't been able to figure out a solution or find one.
CreekTreeUSA is our primary site with a dedicated SSL cert, and Faery's Whimsy, Wizard's Whimsy & Gothic Shadows are add-on domains.
When purchases are made in the add-on carts, the SSL is via CreekTreeUSA. This has worked fine for several years.
We've also had Simple Google Analytics 1.0 (the urchin code) installed since 2007 and it's been working fine as far as we knew, and as far as needed.
Recently we have need to break down the purchases for each store by its traffic source, i.e. referral, google, direct, etc. and found that for the add-on domains all purchases show up as one traffic source, referrals. So we thought maybe updating to the latest version 1.2.2 and using the google code would help, and we updated CreekTreeUSA and one of the add-ons, Faery's Whimsy, to that. However, the results in Ecommerce traffic sources for Faery's Whimsy didn't change, all traffic sources are still referrals.
We're running Zen Cart 1.3.7 on a Zen certified host.
If other info would help, please let us know. Any input gratefully accepted.
Bob & Nancy