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

Simple Google Analytics - Support

Views: 451,171

Results 1,381 to 1,400 of 2,165
3 Dec 2010, 1:24 PM
#1381
econcepts avatar

econcepts

Totally Zenned

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

Simple Google Analytics - Support

cotsweb:

Hi Eric,
The following sort of works;

I can use CustomVar 1 in an advance segment but it shows the values as 'shopLevel' rather than 'Production' which is what I hoped for, still it is usable.

But to save time I have decided just to create an advanced segment on Host Name which gives me a similar result but without messing with custom variables. Nice of you to include it in the module though, I may need it in the future.

Regards
Mark

Ok. I thought it might be in the way the code was used (possibly missing one item.) Glad that worked. However, I am going to send you a file (PM me with your email) that I want you to try on your site. This is the revised file with the code moved to a different location so it might work with your original lines (not needing the second push command.)

3 Dec 2010, 1:26 PM
#1382
cotsweb avatar

cotsweb

New Zenner

Join Date:
Oct 2007
Location:
Stow on the Wold, in the Cotswolds - England
Posts:
13
Plugin Contributions:
0

Re: Simple Google Analytics - Support

yamadan:

Just to add more details to above post;

The file causing the problem is;

/includes/templates/[your_template]/common/html_header.php

If i remove the code snippet added just before the </head> the site is visable again.

Can other modules be causing a problem?
That's the only difference between my test site & this live site.

Hi Yamadan,
I don't know if this is the same problem that I had in a recent install but you could try the following snippet;

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { require($template->get_template_dir('google_analytics.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); } ?>

The only difference between this version and the original is that I have put the full module name 'google_analytics.php' in as the first parameter to get_template_dir(). The original just puts in '.php' for this parameter.

I'm not sure why the original version didn't work for me, I think it should, but it was a quick and simple fix.

Hope this helps
Mark

3 Dec 2010, 1:28 PM
#1383
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

jill8026:

Hey Eric, it is definitely set up properly in Analytics ...... I am baffled! :smile:

That is odd Jill. Can you send me the info to get in and look at the site (if you want)? You've got my email from earlier conversations.

I'd be interested in seeing what might be causing that.

What I would be looking for is the GA login as well as the FTP etc... I want to compare files and look at any possible issues in GA setup.

Thanks!

4 Dec 2010, 12:08 AM
#1384
yamadan avatar

yamadan

New Zenner

Join Date:
Nov 2009
Posts:
60
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Thanks for quick reply econcepts & cotsweb,

I will try both methods & report back.

5 Dec 2010, 8:17 PM
#1385
cre8ive avatar

cre8ive

New Zenner

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

Re: Simple Google Analytics - Support

Hi,

Thanks for this addon, its working well.

One thing I have notices is that if I change the tracking mode from ga.js to Asyncronous it breaks the "Larger Image" link on all my product pages. Changing it back works fine.

Is this a bug? Can you see if you can replicate it? I am using 1.3.9h + Latest ImageHandler2

Thanks,

Ben

6 Dec 2010, 1:16 PM
#1386
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

cre8ive:

Hi,

Thanks for this addon, its working well.

One thing I have notices is that if I change the tracking mode from ga.js to Asyncronous it breaks the "Larger Image" link on all my product pages. Changing it back works fine.

Is this a bug? Can you see if you can replicate it? I am using 1.3.9h + Latest ImageHandler2

Thanks,

Ben

That is interesting Ben.

I haven't seen that or heard it reported.

Can you send me a link to look at?

6 Dec 2010, 8:18 PM
#1387
cre8ive avatar

cre8ive

New Zenner

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

Re: Simple Google Analytics - Support

Hi Eric,

Its on my store http://www.cuffed.com.au however I don't have a test environment, and I've now reverted back to the ga.js script.

Attached is a zipped word document (limit for word attachment was 19.5kb so I had to zip it) and it shows the screenshot and source code of the pop up window if this helps.

7 Dec 2010, 1:41 PM
#1388
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

@cre8ive,

I took a look at that doc and it appears that the page is blank (the pop up) because it stops loading at the point where I would assume the GA script is supposed to be.

There is no GA script which is why I believe this to be the case.

If the rest of the site works (and only the pop-up) page is not working (is the only blank page) then I would have to think that the issue resides somewhere in the way the code was inserted.

Without seeing the actual source (php etc...) it's hard to tell the issue. The best bet to find the error is to look at your error log. Can you look at that and tell me what it says?

I am running the async code on a number of sites with IH2 and have no problems.

14 Dec 2010, 10:25 PM
#1389
infinitearms avatar

infinitearms

New Zenner

Join Date:
Dec 2010
Posts:
1
Plugin Contributions:
0

Re: Simple Google Analytics - Support

I had the same problem (possibly?) with images not showing up in the popup. I checked the html source in the browser and it would not load past one point. Commenting out (<!-- -->) the Simple Google Analytics code from the html_header.php allowed the image to load.

Checking the debug log in the cache directory i found the following errors:

[14-Dec-2010 16:32:34] PHP Warning: require(includes/templates/template_default/popup_image/google_analytics.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/infinite/public_html/shopping/includes/templates/template_default/common/html_header.php on line 129
[14-Dec-2010 16:32:34] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/templates/template_default/popup_image/google_analytics.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/infinite/public_html/shopping/includes/templates/template_default/common/html_header.php on line 129

As a temporary fix i created a sym link between includes/templates/template_default/popup_image/google_analytics.php and includes/templates/template_default/google_analytics/google_analytics.php and everything is working again.

I know this is not a proper fix, let me know if you come up with anything better.

15 Dec 2010, 1:46 PM
#1390
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

infinitearms:

I had the same problem (possibly?) with images not showing up in the popup. I checked the html source in the browser and it would not load past one point. Commenting out (<!-- -->) the Simple Google Analytics code from the html_header.php allowed the image to load.

Checking the debug log in the cache directory i found the following errors:

[14-Dec-2010 16:32:34] PHP Warning: require(includes/templates/template_default/popup_image/google_analytics.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/infinite/public_html/shopping/includes/templates/template_default/common/html_header.php on line 129
[14-Dec-2010 16:32:34] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/templates/template_default/popup_image/google_analytics.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/infinite/public_html/shopping/includes/templates/template_default/common/html_header.php on line 129

As a temporary fix i created a sym link between includes/templates/template_default/popup_image/google_analytics.php and includes/templates/template_default/google_analytics/google_analytics.php and everything is working again.

I know this is not a proper fix, let me know if you come up with anything better.

Ok, I see what is going on (thanks for the error log there.)

The popup page is trying to load the google analytics file from the popup directory instead of the proper one. Since the file is not present where it is looking, it errors off leaving you with a blank page.

I'll get that corrected here. Thanks again for that info.

28 Dec 2010, 12:17 AM
#1391
donhohler avatar

donhohler

New Zenner

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

Re: Simple Google Analytics - Support

econcepts:

Ok, I see what is going on (thanks for the error log there.)

The popup page is trying to load the google analytics file from the popup directory instead of the proper one. Since the file is not present where it is looking, it errors off leaving you with a blank page.

I'll get that corrected here. Thanks again for that info.

Is there a fix for this? I am having the same problem.

14 Jan 2011, 10:45 PM
#1392
redbaron2 avatar

redbaron2

New Zenner

Join Date:
Dec 2010
Posts:
16
Plugin Contributions:
0

Re: Simple Google Analytics - Support

donhohler:

Is there a fix for this? I am having the same problem.

The only fixes I'm aware of is the one posted above with the symbolic link, or just switch to using the ga.js file code. I would really like to use the Asychronous tracking also.

--
Red Baron

24 Jan 2011, 3:27 PM
#1393
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

Just submitted a new 1.2.4 version of this mod that includes a fix for the popup window issue some have experienced.

If you have 1.2.3 version you do not need to upload any files. All you have to do is take the following action to remedy the situation.

Open the file "html_header.php" file from your template directory 'common' folder (making sure you have the proper location for the template you are using if custom.)

  1. Once opened, find the section of code that looks like this (usually just before the closing </HEAD> tag):

Find this:

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); } ?>

And change to this:

<?php /* Begin Simple Google Analytics */ if (in_array($current_page_base,explode(",",'popup_image,popup_image_additional,popup_cvv_help,popup_coupon_help,popup_attributes_qty_prices,popup_search_help,popup_shipping_estimator')) ) { //Skip outputting the tracking code as this is a pop-up window } else { // Print tracking code to page if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); } } // end if for page determination /* End Simple Google Analytics */ ?>

That should correct the issue. If you find that any other pages are causing the same issue (I think I got them all) just add that to the array shown here and it will eliminate the problem on those pages.)

If you can' wait for the new version to be activated in the Zen Cart downloads section you can get the newest version from the following link right now:

http://www.zencartoptimization.com/downloads/

Post any issues in this forum.

25 Jan 2011, 9:59 PM
#1394
bi11i avatar

bi11i

Zen Follower

Join Date:
Jun 2005
Location:
Portland, OR
Posts:
157
Plugin Contributions:
0

Re: Simple Google Analytics - Support

I love this add-on! Has really helped with my biz! Having one small prob, though - it's not tracking every conversion. Almost all of them but not every one. Maybe one in ten doesn't come through. I can't see any rhyme or reason to it, either. No particular customer, product, or payment method. What could cause this? Right now I have a difference of about $1100 between google and sales reports from within zen. I can see the missing order numbers in analytics.

Help?

25 Jan 2011, 10:11 PM
#1395
bi11i avatar

bi11i

Zen Follower

Join Date:
Jun 2005
Location:
Portland, OR
Posts:
157
Plugin Contributions:
0

Re: Simple Google Analytics - Support

nm, i see my answer at post #1318.

26 Jan 2011, 2:30 PM
#1396
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

Thanks for letting us know you found the answer and what post other can find it at as well. There will always be a slight margin of error with any analytics package you use which utilizes JavaScript (as Google Analytics does).

This is a native issue with the tracking programs, not the module itself.

29 Jan 2011, 7:22 AM
#1397
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: Simple Google Analytics - Support

Hello,

I’ve installed this module a few days ago on our new zc site. (we already had a google analytics account using the Asynchronous code on our old static site.)

  • When I set the Asynchronous tracking preference under the admin, the product pages display blank.

  • When I set the ga.js tracking under the admin, the product pages display all right but they are not being tracked by google analytics. All other pages seem to get tracked all right.

Do you know what’s wrong?

our site is ezistock(dot)com
Thanks much!

30 Jan 2011, 7:17 AM
#1398
redbaron2 avatar

redbaron2

New Zenner

Join Date:
Dec 2010
Posts:
16
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Thannaree:

...

  • When I set the Asynchronous tracking preference under the admin, the product pages display blank.
  • When I set the ga.js tracking under the admin, the product pages display all right but they are not being tracked by google analytics. All other pages seem to get tracked all right.

Do you know what’s wrong?
Thanks much!
Your code is in the wrong area of your page. I also think the onload line is not firing for your pages.
econcepts:

...
Open the file "html_header.php" file from your template directory 'common' folder (making sure you have the proper location for the template you are using if custom.)

  1. Once opened, find the section of code that looks like this (usually just before the closing </HEAD> tag): Your code is in the bottom of your pages before the </body> tag.
31 Jan 2011, 1:10 AM
#1399
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: Simple Google Analytics - Support

Redbaron2: Your code is in the bottom of your pages before the </body> tag.

Yes its is. I've pasted both codes as indicated on the install instructions. This one is supposed to be pasted there on tpl_main_page.php. Perhaps you're refering to the one to be pasted on html_header.php before </head>...

The body tag on tpl_main_page.php also includes the onload code.

I don't understand why the code doesn't show on the product pages source only.

Do you know what's wrong?

31 Jan 2011, 2:59 PM
#1400
econcepts avatar

econcepts

Totally Zenned

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

Re: Simple Google Analytics - Support

Thannaree:

Yes its is. I've pasted both codes as indicated on the install instructions. This one is supposed to be pasted there on tpl_main_page.php. Perhaps you're refering to the one to be pasted on html_header.php before </head>...

The body tag on tpl_main_page.php also includes the onload code.

I don't understand why the code doesn't show on the product pages source only.

Do you know what's wrong?

A blank page means you have an error in your PHP somewhere.
Most likely from something inadvertently altered during install (specifically during the install portion where you had to add the few lines of code to the html header and tpl main page files.)

To correct this you need to find where your error is. To find the erro you should turn on error logging in your cart (if you have zen 1.3.9 + it is already turned on by default.) If you have an older version of zen cart (lower than 1.3.9) you'll need to add the error logging to your site (just a single file) using the following file and instructions.

http://www.zen-cart.com/forum/showthread.php?t=84613

Once you have that in place, just activate the contribution (asyc code if that is what causes the error / white page) and then navigation to the product page. (This will throw the 'white page').

Now go to your server (FTP in) and look at the error log that was just generated in the /cache/ directory (starts with "myDEBUG..."). Download that, open it and read the error message. It should tell you the exact line and location of the error.

Find that section of code and rework it adding the missing element and you should be ready to go.

Let me know if you have any other problems. I'd be happy to walk you through them.