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

Simple Google Analytics - Support

Views: 451,182

Results 1,301 to 1,320 of 2,165
1 Oct 2010, 4:03 PM
#1301
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Simple Google Analytics - Support

I'm confused. I've installed and configured the mod and my site is receiving data. I need to continue to track ecommerce conversions but I can't seem to get that section of the tracking code to generate. It seems like this code is not triggering as true:
if($page_directory == 'includes/modules/pages/checkout_success') {

and the else clause is treating it as a normal page.

Any ideas?

btw I'm running 1.3.9g with cowoa added

1 Oct 2010, 4:49 PM
#1302
nycxkkoma avatar

nycxkkoma

New Zenner

Join Date:
Aug 2010
Posts:
13
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hello,

I just checked again, now it says receiving data. I thought that sign comes up right away, but guess not. Thank you.

2 Oct 2010, 12:47 PM
#1303
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

badarac:

I'm confused. I've installed and configured the mod and my site is receiving data. I need to continue to track ecommerce conversions but I can't seem to get that section of the tracking code to generate. It seems like this code is not triggering as true:
if($page_directory == 'includes/modules/pages/checkout_success') {

and the else clause is treating it as a normal page.

Any ideas?

btw I'm running 1.3.9g with cowoa added

Are you sure you are running SIMPLE Google Analytics? That line is not in any of my code. I think you must be running Andrew's version of Google analytics.

My version (Simple Google Analytics) has ecommerce tracking built in by default no site or code adjustments needed.

My version also works on all zen cart version (even 1.3.9 +)

2 Oct 2010, 12:48 PM
#1304
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

nycxkkoma:

Hello,

I just checked again, now it says receiving data. I thought that sign comes up right away, but guess not. Thank you.

Yes, it can take time for Google to show that it is receiving data.

Glad you got it working!

4 Oct 2010, 12:38 PM
#1305
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

Are you sure you are running SIMPLE Google Analytics? That line is not in any of my code. I think you must be running Andrew's version of Google analytics.

My version (Simple Google Analytics) has ecommerce tracking built in by default no site or code adjustments needed.

My version also works on all zen cart version (even 1.3.9 +)

Hi Eric,
Yes I checked and it is in fact your mod. That line of code appears in your includes/templates/my_templates/google_analytics/google_analytics.php
at around line 81. For some reason it's not detecting that the calling page is checkout_success. I added some text to the else path to verify that it was in fact executing the else code and it is. Any suggestions?

5 Oct 2010, 12:18 PM
#1306
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

badarac:

Hi Eric,
Yes I checked and it is in fact your mod. That line of code appears in your includes/templates/my_templates/google_analytics/google_analytics.php
at around line 81. For some reason it's not detecting that the calling page is checkout_success. I added some text to the else path to verify that it was in fact executing the else code and it is. Any suggestions?

I see that here. Are you using the newest version? (I thought I changed that line a while back ... it will be altered in the next release (out soon with some great new features.)

Do this for me.

Change that line of code to the following and see if it has any effect (this is the line of code that it is being altered to in the new release)

if ($_GET['main_page']=="checkout_success") {

So you are removing the previous line of code and in place of it adding this. (Do this in each location that appears in the script.)

Let me know if that has any impact. I've never heard of this mod every causing any issues with that line (or ecommerce tracking at all) and I've got it running on 1.3.9+ versions with no issues.

There is always a first time for everything though and we'll figure out what is causing it.

Let me know if the above works!

5 Oct 2010, 12:44 PM
#1307
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

I see that here. Are you using the newest version? (I thought I changed that line a while back ... it will be altered in the next release (out soon with some great new features.)

Do this for me.

Change that line of code to the following and see if it has any effect (this is the line of code that it is being altered to in the new release)

if ($_GET['main_page']=="checkout_success") {

> 
> So you are removing the previous line of code and in place of it adding this. (Do this in each location that appears in the script.)
> 
> Let me know if that has any impact. I've never heard of this mod every causing any issues with that line (or ecommerce tracking at all) and I've got it running on 1.3.9+ versions with no issues.
> 
> There is always a first time for everything though and we'll figure out what is causing it.
> 
> Let me know if the above works!

I made the change and it still doesn't detect the checlout success module. Here's what is being generated on the checkout success page: 

<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-xxxxxxx-1");
pageTracker._initData();
pageTracker._trackPageview();
</script></body></html>

I made the change two places in the file. Here is the version info from the install file: 
Version Date: v 1.2.2 01/09/2008 Eric Leuenberger (Zen ID: econcepts) <http://www.zencartoptimization.com>. If there's a different version available somewhere for download I'll be happy to try it.
5 Oct 2010, 12:49 PM
#1308
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

badarac:

I made the change and it still doesn't detect the checlout success module. Here's what is being generated on the checkout success page:

<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-xxxxxxx-1"); pageTracker._initData(); pageTracker._trackPageview(); </script></body></html>

I made the change two places in the file. Here is the version info from the install file:
Version Date: v 1.2.2 01/09/2008 Eric Leuenberger (Zen ID: econcepts) http://www.zencartoptimization.com. If there's a different version available somewhere for download I'll be happy to try it.

A few things.

  1. Your tracking code is not in place. I see 'UA-xxxxxxx-1' and that should be your tracking code. Make sure you enter that code within the admin or the tracking will not work.

  2. Are you running any affiliate programs or anything else that might affect the checkout page? If so, there is a different way I'll have you integrate it. Sometimes those mods make alterations to the checkout success page that override any tracking.

  3. You might want to switch to the Urchin form of the tracking for a short time as it is more accurate on ecommerce tracking. But I don't see the ecom tracking code on the thank you page (likely due to other mods which alter the checkout success page as mentioned) and so this is just a side note to consider.

Let me know answers to the above and if you want to send me a url to the site I can look at that as well.

5 Oct 2010, 1:10 PM
#1309
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

A few things.

  1. Your tracking code is not in place. I see 'UA-xxxxxxx-1' and that should be your tracking code. Make sure you enter that code within the admin or the tracking will not work.

  2. Are you running any affiliate programs or anything else that might affect the checkout page? If so, there is a different way I'll have you integrate it. Sometimes those mods make alterations to the checkout success page that override any tracking.

  3. You might want to switch to the Urchin form of the tracking for a short time as it is more accurate on ecommerce tracking. But I don't see the ecom tracking code on the thank you page (likely due to other mods which alter the checkout success page as mentioned) and so this is just a side note to consider.

Let me know answers to the above and if you want to send me a url to the site I can look at that as well.

Sorry, I should have mentioned that I edited the account number.. It's actually set in the config settings.

I'm not running any affiliate programs and the only mod to the tpl_checkout_success_default.php is from the current COWOA mod. The analytics code is being called from the main page which was unmodified until I added the following line as instructed <?php require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); ?>. Otherwise it is unmodified from the one in template_default.

The site is https://www.beachtradingco.com. You can call me on the 800 number if you want to kick stuff around real time.

5 Oct 2010, 4:29 PM
#1310
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Just a quick update. I added a line to have it echo the main_page in each path of the if statement. It seems that for some reason the main page variable as soon as I start the checkout process is set to time_out. It stays set at that value through the entire checkout process. This has to be related somehow to the COWOA mod but so far I can't see it. The url is correctly built for each checkout page. Weird.

6 Oct 2010, 12:14 PM
#1311
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

badarac:

Just a quick update. I added a line to have it echo the main_page in each path of the if statement. It seems that for some reason the main page variable as soon as I start the checkout process is set to time_out. It stays set at that value through the entire checkout process. This has to be related somehow to the COWOA mod but so far I can't see it. The url is correctly built for each checkout page. Weird.

I'm on the site now and just ran a test order. When I view the source throughout the entire process (including on the checkout success page) the tracking code is in place.

This does include the ecommerce tracking as well. It is in place and looks to be working as it should. So, if you are not seeing ecommerce tracking then there must be something else wrong within your Google Analytics account.

Did you let Google know you want to track ecommerce transactions? You have to tell Google you want to track them (from within your Google Analytics profile) for the ecommerce tracking data that is passed in the code to actually be recorded by Google. If you don't do that, no matter if the code is working or not, the data will not be saved on Google's end.

6 Oct 2010, 12:34 PM
#1312
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

I'm on the site now and just ran a test order. When I view the source throughout the entire process (including on the checkout success page) the tracking code is in place.

This does include the ecommerce tracking as well. It is in place and looks to be working as it should. So, if you are not seeing ecommerce tracking then there must be something else wrong within your Google Analytics account.

Did you let Google know you want to track ecommerce transactions? You have to tell Google you want to track them (from within your Google Analytics profile) for the ecommerce tracking data that is passed in the code to actually be recorded by Google. If you don't do that, no matter if the code is working or not, the data will not be saved on Google's end.

Eric,
I really apologize for all the confusion. It looks like this is a browser problem. I tried placing an order using the Firefox browser which I normally use and the ecommerce code was not generated. After getting your reply I got to thinking that this might be a browser issue and placed a test order using Chrome. Lo and behold the ecommerce code was generated and populated with all the right stuff. I'm gonna go clear everything in the FF browser and crawl back under my rock. Thanks for the help. :blush:

6 Oct 2010, 6:45 PM
#1313
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

badarac:

Eric,
I really apologize for all the confusion. It looks like this is a browser problem. I tried placing an order using the Firefox browser which I normally use and the ecommerce code was not generated. After getting your reply I got to thinking that this might be a browser issue and placed a test order using Chrome. Lo and behold the ecommerce code was generated and populated with all the right stuff. I'm gonna go clear everything in the FF browser and crawl back under my rock. Thanks for the help. :blush:

No problem. It should work on ANY browser though. I ran it on FireFox myself and saw the tracking code just fine.

I also ran it on Safari and IE and it was fine. There is nothing in the code that would prevent it from showing from browser to browser.

However, check to see if you have DISABLED javascript on your FireFox browser as that would cause the code not to show (of course).

6 Oct 2010, 6:54 PM
#1314
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Simple Google Analytics - Support

econcepts:

No problem. It should work on ANY browser though. I ran it on FireFox myself and saw the tracking code just fine.

I also ran it on Safari and IE and it was fine. There is nothing in the code that would prevent it from showing from browser to browser.

However, check to see if you have DISABLED javascript on your FireFox browser as that would cause the code not to show (of course).
Javascript is enabled in my browser. This trouble is related to something unique to the Firefox/PC environment I'm running on. I created a new post in the general section to see if anybody can help with debugging this problem. You're mod works fine. Here's a link in case anybody can help. http://www.zen-cart.com/forum/showthread.php?t=165451

6 Oct 2010, 7:27 PM
#1315
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

badarac:

Javascript is enabled in my browser. This trouble is related to something unique to the Firefox/PC environment I'm running on. I created a new post in the general section to see if anybody can help with debugging this problem. You're mod works fine. Here's a link in case anybody can help. http://www.zen-cart.com/forum/showthread.php?t=165451

Ah gotcha! I'll follow it there to see what comes of it.

13 Oct 2010, 9:42 PM
#1316
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hi Eric, I have a problem with tracking that I would be very grateful if you helped with.

We are running your Simple Analytics Plugin on Zen Cart 1.3.8a. I have had the code installed and running for quite some time but haven't spent the time trying to get to understand things until recently.

I have conversion tracking turned on and integrated with Google Adwords.

At the moment there seems to be a discrepency between the data in the zen cart admin panel, in Google Analytics, and in Google Adwords Conversion Reporting.

(We are only a small start up so the figures are very low but we are working on our adwords campaigns to try and improve sales, so having accurate information is quite important)

This is a summary of the data in each for yesterday:

  1. Zen Cart - 2 sales. One sale of $18.90 and one of $18.12.
  2. Google Analytics - 1 sale registered only - the one of $18.12. Where is the sale at $18.90?
  3. Google Adwords - 2 conversions reported - value $73.12. This looks like it picked up the $18.12 sale but this leaves a supposed sale of $55 that never happened.

Your advice on this would be much appreciated.

Thank you in advance.

Nathan

14 Oct 2010, 1:04 PM
#1317
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

nathanscrivener:

This is a summary of the data in each for yesterday:

First thought is to make sure that Google has had time to fully update. I have noticed that sometimes (depending on when a sale was made) it may take up to 24 hours for the full amount of data to show for a given day.

Second thing to consider is that there will always be some type of discrepancy in reporting across platforms due to any of the following reasons:

a) Javascript is turned off or being blocked by the client browser. (Google analytics is based on Javascript tracking so anyone with that blocked or disabled will not show in reports.)

b) The discrepancies are bigger if using the ga.js version of the tracking code. I have noticed that the older legacy "urchin" code has the most accurate tracking across the board (again, a google thing.)

c) Each tracking system you use provides data that reports on DIFFERENT aspects of your business (see response to your question #3 below for more on this.)

nathanscrivener:

  1. Zen Cart - 2 sales. One sale of $18.90 and one of $18.12.

This is ALWAYS going to the the 'right number' of sales. Obviously if a sale is completed, it will show as a 'new order' on the zen cart side ... no way around that. So for the most accurate 'sales numbers' (revenue that is) you would want to turn to the zen cart store.

nathanscrivener:

  1. Google Analytics - 1 sale registered only - the one of $18.12. Where is the sale at $18.90?

This is common with analytics based on the information I listed in the very first part of the response. The one sale that did not record could have been a user with Javascript or something disabled or blocked (it happens a lot more than you think.)

nathanscrivener:

  1. Google Adwords - 2 conversions reported - value $73.12. This looks like it picked up the $18.12 sale but this leaves a supposed sale of $55 that never happened.

This is perplexing to me to some degree only because the (sales) values are different that which you have told my in part 1.

However, it is VERY possible that you get 2 sales, and only one shows in the Adwords side. Why? Because you'll only see a sale within Adwords if that sale came directly from your ppc advertising. If you get a sale that did not first come through an ad of yours, it will show in analyticxs, but NOT adwords. For a sale to show in Adwords the visitor has to first click on an ad of yours to get to your site.

You wouldn't want to track sales as coming from adwords if they really didn't or you would not be able to gather accurate data to find out how well your adwords is performing.

Think of it this way. Google Analytics data is separate from Google Adwords (but they both tie together to give the most accurate data) and Google Ecommerce data is slightly 'stand alone' as well from the rest (yet ties in for more accurate data.) They are all not one system and are meant to track different aspects of your business.

When users try to associate them as all being one, that is when they get confused as to what the data really means. 'Reading' analytic data is far different from 'Interpreting' analytic data.

Hope that helps.

14 Oct 2010, 5:55 PM
#1318
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hi Eric, thank you very much for your reply.

I have switched the plugin the urchin.gs mode, to see if that delivers more accurate results in Google Analytics. I was under the impression from the text in the plugin that this is something that was to be fixed by google in 2008. I guess that never happened.

So I follow that if the user has javascript switched off, then the sale will not record in Google Analytics. I wonder how common this is?

My main concern, which remains unanswered, is this sale of $55 recorded in conversion reports in Google Adwords that never happened. Or alternatively it picked up the other sale that Google Analytics missed, but got the order value wrong. Could this be an issue in the plugin code? Could this be explained by a default conversion value?

Thanks again and I look forward to your reply.

15 Oct 2010, 2:02 PM
#1319
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

nathanscrivener:

My main concern, which remains unanswered, is this sale of $55 recorded in conversion reports in Google Adwords that never happened. Or alternatively it picked up the other sale that Google Analytics missed, but got the order value wrong. Could this be an issue in the plugin code? Could this be explained by a default conversion value?

It definitely isn't the plugin code, I have used this code on a large number of sites for years and have had no issues like that.

If you have a 'default' conversion value setup (within your Google Analytics, then this could cause the problem.) Leave all default conversion values to blank or '0'.

I never set default conversion values as I use the dynamic (more realistic) values.

15 Oct 2010, 7:17 PM
#1320
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hi Eric

I really don't know where to turn from here ... I checked G Analytics and there are no default conversion values that I can see ... so where has this conversion value figure come from?

Do you have any suggestions?