Zen Cart Logo
Forums / All Other Contributions/Addons / Simple Google Analytics - Support

Simple Google Analytics - Support

Views: 451,190

Results 1,001 to 1,020 of 2,165
13 Sep 2009, 8:01 PM
#1001
mommed avatar

mommed

New Zenner

Join Date:
Sep 2009
Posts:
2
Plugin Contributions:
0

Simple Google Analytics - Support

I tried this already, had no luck :huh:

16 Sep 2009, 5:14 PM
#1002
iscatech avatar

iscatech

New Zenner

Join Date:
Mar 2009
Posts:
48
Plugin Contributions:
0

Re: Simple Google Analytics - Support

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?

17 Sep 2009, 12:07 AM
#1003
iscatech avatar

iscatech

New Zenner

Join Date:
Mar 2009
Posts:
48
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Here is the relevant 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>
17 Sep 2009, 12:34 AM
#1004
iscatech avatar

iscatech

New Zenner

Join Date:
Mar 2009
Posts:
48
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Here is the code from tpl_main_page.php:

<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');
?>
20 Sep 2009, 12:59 PM
#1005
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

mommed:

I can't get this to work, but the template I'm using didn't have a tpl_main_page.php file in the suggested area. I tried modifying it everywhere lse I could find one.

If I do a view source from any page on my site, I can't see the google analytics code.

Can anyone suggest what I need to try next?

Thanks.

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.

20 Sep 2009, 1:02 PM
#1006
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

iscatech:

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?

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.

21 Sep 2009, 6:17 PM
#1007
iscatech avatar

iscatech

New Zenner

Join Date:
Mar 2009
Posts:
48
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

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.

Yes this was it. I think I tried putting it in the tpl_mainpage when I was having other problems, and I forgot to remove it.

I removed the hand entered code and left the code per the instructions, and everything works great. Finally!

29 Sep 2009, 6:54 PM
#1008
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: Simple Google Analytics - Support

What's the best way to track referrals in Analytics using a url parameter? Such as:

https://www.domain.com/?referrer=emaillink
https://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.

30 Sep 2009, 10:45 PM
#1009
ctopher avatar

ctopher

New Zenner

Join Date:
Nov 2006
Posts:
24
Plugin Contributions:
0

Re: Simple Google Analytics - Support

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 https://www.oursite.com and the store's index.php is https://www.oursite.com/inner/store/

We have people come to https://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 https://www.oursite.com/inner/store is all direct! If we look at Analytics' "Top Landing Pages" https://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?

1 Oct 2009, 4:04 PM
#1010
inovermyhead avatar

inovermyhead

Zen Follower

Join Date:
Feb 2007
Posts:
154
Plugin Contributions:
0

Re: Simple Google Analytics - Support

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

3 Oct 2009, 12:31 PM
#1011
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

fakeDecoy:

What's the best way to track referrals in Analytics using a url parameter? Such as:

https://www.domain.com/?referrer=emaillink
https://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.

Add the following to your email links to segment them in your analytics:

?utm_source=Email

You can't easily track those that copy and paste into the address bar and those will always show as "direct" in your analytics.

3 Oct 2009, 12:37 PM
#1012
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

ctopher:

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 https://www.oursite.com and the store's index.php is https://www.oursite.com/inner/store/

We have people come to https://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 https://www.oursite.com/inner/store is all direct! If we look at Analytics' "Top Landing Pages" https://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?

Some thoughts:

  1. If your traffic coming into "inner..." is only test traffic at this point (or in other words traffic that can get there through the links you provide only outside of the website) then it will always show as direct no matter what.

  2. If your analytics is setup correctly across the store, the site pages, etc... then you should see an constant flow from page to page and those that move from the site to the store and vice versa will not show as direct but as "coming from" (a page).

Make sure you are using the same GA tracking ID across the entire site (not two different ones by mistake).

  1. I have a number of sites setup like this and the bottom line is so long as the analytics is setup correctly the flow should be there once all pages link to each other (and you don't have just select "test" traffic coming to the inner pages.)
3 Oct 2009, 12:41 PM
#1013
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

inovermyhead:

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

Bob,

To make sure I understand, it sounds like you are trying to track multiple website urls as separate domains with one analytics account right?

A few thoughts for you.

  1. This can be done with one analytics account but the code would need to bee altered.

  2. have you considered setting up multiple website profiles under your one analytics account for each of your domains? This would provide you with a unique tracking id for each domain that you can use to track them separately from within your one analytics account.

3 Oct 2009, 2:16 PM
#1014
inovermyhead avatar

inovermyhead

Zen Follower

Join Date:
Feb 2007
Posts:
154
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

Bob,

To make sure I understand, it sounds like you are trying to track multiple website urls as separate domains with one analytics account right?

A few thoughts for you.

  1. This can be done with one analytics account but the code would need to bee altered.

  2. have you considered setting up multiple website profiles under your one analytics account for each of your domains? This would provide you with a unique tracking id for each domain that you can use to track them separately from within your one analytics account.

Thanks for the response. You're right, and I should have mentioned, we do have multiple profiles set up, UA-XXXXXXX-1 thru UA-XXXXXXX-4 (the XXXXXXX is the same for all 4 sites), and the corresponding profile ID is entered into the Analytics Account field in the Analytics Configuration. Was wondering if the Affiliation needed to be something specific, though. Also, version 1.2.2 has only been installed on -3 (CreekTreeUSA) and -4 (Faery's Whimsy, as those are the ones we're working with right now. The CreekTreeUSA profile DOES show all the breakdowns by traffic source for eCmmerce, but the others don't.

6 Oct 2009, 3:00 PM
#1015
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

inovermyhead:

Thanks for the response. You're right, and I should have mentioned, we do have multiple profiles set up, UA-XXXXXXX-1 thru UA-XXXXXXX-4 (the XXXXXXX is the same for all 4 sites), and the corresponding profile ID is entered into the Analytics Account field in the Analytics Configuration. Was wondering if the Affiliation needed to be something specific, though. Also, version 1.2.2 has only been installed on -3 (CreekTreeUSA) and -4 (Faery's Whimsy, as those are the ones we're working with right now. The CreekTreeUSA profile DOES show all the breakdowns by traffic source for eCmmerce, but the others don't.

So you have multiple profiles and each ecommerce site has it's "own" Simple GA installed AND each of those has entered the unique Analytics ID in the admin right? (just making sure).

Are you using the "ga.js" or the "legacy (urchin)" tracking code? What happens if you switch between them (shouldn't have any effect but just covering the bases here.)

Do you have ecommerce tracking enabled on the other profiles that are not showing it, and do you have those tracking IDs entered in the Simple GA admin (in zen) as well?

Let me know the answers to those and we'll see where that takes us.

6 Oct 2009, 6:29 PM
#1016
inovermyhead avatar

inovermyhead

Zen Follower

Join Date:
Feb 2007
Posts:
154
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hello, econcepts, thanks for your time.

econcepts:

So you have multiple profiles and each ecommerce site has it's "own" Simple GA installed AND each of those has entered the unique Analytics ID in the admin right? (just making sure).
Each of the sites has Simple GA installed, and the pertinent Analytics Profile ID is entered into Analytics Accounts in the SGA Configuration. (The Affiliation field has the shop name in it, not the Profile ID. Not sure exactly what that is for.)

econcepts:

Are you using the "ga.js" or the "legacy (urchin)" tracking code? What happens if you switch between them (shouldn't have any effect but just covering the bases here.)
CreekTreeUSA and Faery's Whimsy are using ga.js, the other 2 still have the legacy version of Simple GA.

econcepts:

Do you have ecommerce tracking enabled on the other profiles that are not showing it, and do you have those tracking IDs entered in the Simple GA admin (in zen) as well?
All 4 profiles have "Yes, an E-Commerce Site" chosen. As for the "tracking IDs" isn't that the same as the Analytics Profile ID? If not, where do I find the "tracking ID"?

The information in the profiles was set up 2 years ago, and it looks like there may have been some changes since then. For instance, I just noticed that the goal steps are set up with the domain name ( i.e. https://www.creektree.net/faeryswhimsy/index.php?main_page=checkout_shipping) and there's a note there now that the domain name shouldn't be included. Is that right?

Really appreciate the help on this econcepts.

Bob

6 Oct 2009, 11:07 PM
#1017
kristinalynn avatar

kristinalynn

New Zenner

Join Date:
Aug 2009
Posts:
16
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hi Everyone!
I'm sure this is going to be a simple question to answer but we will see! I'm running ZenCart 1.3.8. I downloaded and modified one of the free templates from (sorry, site offline). I'm now trying to add Google Analytics and it says to modify the /includes/templates/[your_template]/common/tpl_main_page.php file. The only files that came with the free template are: CSS, images, and a template_info.php file. My question is, where do I put the code? Do I need to copy files from the template_default folder into my custom template folder?

Thanks for your help!

Kristina Marshall

7 Oct 2009, 3:03 PM
#1018
inovermyhead avatar

inovermyhead

Zen Follower

Join Date:
Feb 2007
Posts:
154
Plugin Contributions:
0

Re: Simple Google Analytics - Support

KristinaLynn:

Hi Everyone!
I'm sure this is going to be a simple question to answer but we will see! I'm running ZenCart 1.3.8. I downloaded and modified one of the free templates from (sorry, site offline). I'm now trying to add Google Analytics and it says to modify the /includes/templates/[your_template]/common/tpl_main_page.php file. The only files that came with the free template are: CSS, images, and a template_info.php file. My question is, where do I put the code? Do I need to copy files from the template_default folder into my custom template folder?

Thanks for your help!

Kristina Marshall
Hi, Kristina ... just create a 'common' folder in the your_template folder, then copy the tpl_main_page.php file to it from the default_template/common folder, and make your changes to the new tpl_main_page.php file. Many changes for Zen Cart custom code can be made similarly, without touching the original code.

7 Oct 2009, 4:30 PM
#1019
kristinalynn avatar

kristinalynn

New Zenner

Join Date:
Aug 2009
Posts:
16
Plugin Contributions:
0

Re: Simple Google Analytics - Support

inovermyhead:

Hi, Kristina ... just create a 'common' folder in the your_template folder, then copy the tpl_main_page.php file to it from the default_template/common folder, and make your changes to the new tpl_main_page.php file. Many changes for Zen Cart custom code can be made similarly, without touching the original code.

Thanks for your help! I do believe I have everything installed correctly. I went in to the admin side of my site and put in the UA code but nothing is showing up in my analytics for my store. Do I need to add a new account in Google Analytics and point it to my store? Will there be more code I need to enter?

7 Oct 2009, 7:55 PM
#1020
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

inovermyhead:

Hello, econcepts, thanks for your time.

Each of the sites has Simple GA installed, and the pertinent Analytics Profile ID is entered into Analytics Accounts in the SGA Configuration. (The Affiliation field has the shop name in it, not the Profile ID. Not sure exactly what that is for.)

CreekTreeUSA and Faery's Whimsy are using ga.js, the other 2 still have the legacy version of Simple GA.

All 4 profiles have "Yes, an E-Commerce Site" chosen. As for the "tracking IDs" isn't that the same as the Analytics Profile ID? If not, where do I find the "tracking ID"?

The information in the profiles was set up 2 years ago, and it looks like there may have been some changes since then. For instance, I just noticed that the goal steps are set up with the domain name ( i.e. https://www.creektree.net/faeryswhimsy/index.php?main_page=checkout_shipping) and there's a note there now that the domain name shouldn't be included. Is that right?

Really appreciate the help on this econcepts.

Bob

Bob,

You can still use the "http:" portion and domain for the url that won't be a problem. Google just recommends the other way (but I do it both).

The best thing to do here might be for me to take a look at what you have in the backend. I'll do some more looking at the front end now that I have links and see if I can't turn anything up.

Hang on ...