Shopping Cart Forum

Go Back   eShop Forums - eCommerce Help Forum for Shopping Cart Owners. > Shopping Cart Software > Zen Cart & osCommerce
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Zen Cart & osCommerce Tips, advice and help on how to use the most popular free E-commerce shopping carts available.

econsultancy.com
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2008, 09:40 AM
Arkwright Arkwright is offline
Member
 
Join Date: Aug 2007
Posts: 80
Thanks: 0
Thanked 3 Times in 3 Posts
Default Google Analytics Problem..

I have installed the Simple Google Analytics Module and it appears in my Admin>Configuration.

I have signed up with Google analytics and inserted my unique analytics account number in the relevant box and clicked update.

I was under the assumption that doing this would add the code needed on all my pages for google to track.

However, when I go to my Google Analytics account, it says the tracking codes have not been installed...

Any ideas?

Regards
Arkie.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-01-2008, 07:48 PM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,347
Thanks: 3
Thanked 87 Times in 87 Posts
Default Re: Google Analytics Problem..

I've never used the Analytics mod for Zen so I don't know how it works, but I doubt it would insert the code for you because it won't have permission to write to the required files. There's probably some code you need to add to the footer of the page yourself. If you read the readme file that would have come with the mod, it should tell you how to do this.

To add the Analytics code by hand without a Zen mod, you need to add the code Google gives you to the footer of your site. To see how to do this and get around the SSL problem see my last post on this thread about adding it to OSC. How to add Google Analytics to osCommerce You use the same principle to add it to Zen.
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-01-2008, 08:35 PM
Arkwright Arkwright is offline
Member
 
Join Date: Aug 2007
Posts: 80
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Google Analytics Problem..

hi Lawrence

From what I can make out, the mod should insert the code on all pages. However, it's not doing what it says on the tin, so happy to try your method...

Unfortunately in Zencart, I don't seem to have footer.PHP?

Is it called something else in Zen?

Thanks
Arkie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-01-2008, 09:14 PM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,347
Thanks: 3
Thanked 87 Times in 87 Posts
Default Re: Google Analytics Problem..

The mod cannot insert code into other pages as the server would never allow it to as it wouldn't have write permisions for the file.

I've just checked the install instructions and it gives you some code to insert into a file which hasn't been done. No.3 on the install list is

PHP Code:
3. At the bottom of /includes/templates/[your_template]/common/tpl_main_page.php
Add copy and paste the following lines of code just before the </body> tag:
 
<?php
require($template->get_template_dir('.php',DIR_WS_TEMPLATE$current_page_base,'google_analytics') . '/google_analytics.php');
?>
If you do this, it should work.
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 13-01-2008, 07:49 AM
Arkwright Arkwright is offline
Member
 
Join Date: Aug 2007
Posts: 80
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Google Analytics Problem..

Still hasn't resolved the problem unfortunately...

How about we try the other method you described? Just don't know which PHP file to insert the code into as I don't seem to have a footer.PHP

Arkie...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 13-01-2008, 10:36 AM
dezina's Avatar
dezina dezina is offline
http://dezina.com
 
Join Date: Sep 2007
Location: England
Posts: 634
Blog Entries: 6
Thanks: 14
Thanked 85 Times in 82 Posts
Default Re: Google Analytics Problem..

Quote:
as I don't seem to have a footer.PHP
This is where zencart templates overide system comes into force..
Open /includes/templates/template_default/common/tpl.footer.php
Save a copy of that file to
/includes/templates/NAMEOFYOURCURRENTTEMPLATE/common
Then edit the file you just copied as per Lawrence's instructions..
Done
__________________

and
Unusual and Special Gifts
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 13-01-2008, 04:43 PM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,347
Thanks: 3
Thanked 87 Times in 87 Posts
Default Re: Google Analytics Problem..

You now have the Google code three times on each page which is only going to confuse Google. You need to remove two of them. I suspect one of them is from the Zen mod, if so, you should leave that one on as it'll add features to your store that the code alone won't have and remove the other two.

Also, one of them doesn't switch to SSL when someone views a secure page creating a cert error. This is the footer of one of your SSL pages.

PHP Code:
<!--eof-banner #5 display -->
 
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-3388541-1";
urchinTracker();
</script>
 
 
<!--bof- site copyright display -->
<div id="siteinfoLegal" class="legalCopyright">Copyright &copy; 2008 <a href="http://www.arkwrightandgladys.com" target="_blank">Float On By</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a></div>
<!--eof- site copyright display -->
</div>
<!--bof- parse time display -->
<!--eof- parse time display -->
<!--bof- banner #6 display -->
<!--eof- banner #6 display -->
 
 
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3388541");
pageTracker._initData();
pageTracker._trackPageview();
</script>
 
 
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-3388541";
urchinTracker();
</script>
 
</body></html> 
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 13-01-2008, 05:17 PM
Arkwright Arkwright is offline
Member
 
Join Date: Aug 2007
Posts: 80
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Google Analytics Problem..

Why is life so damned complicated....?

So do I have to open every page and remove them or is there an easier way?

And I haven't got a clue what the SSL part of your message means, what do I do about it?

Finally is having google analytics worth all this trouble, should I just delete it?

Thanks
Arkie...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 13-01-2008, 05:26 PM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,347
Thanks: 3
Thanked 87 Times in 87 Posts
Default Re: Google Analytics Problem..

Just delete the code from the template file that Dazina gave you.

If you click login on your site, you'll see what I mean about the SSL problem.

BTW How do you know it wasn't working before? You have to visit your site when the code is installed before Google will be aware that it is installed, it also doesn't update immediately so you have to wait. What was probably happening is that it was working fine from when you added the bit of code I pointed you to in one of my previous posts but Google hadn't had a chance to update your status yet,
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 14-01-2008, 06:04 AM
Arkwright Arkwright is offline
Member
 
Join Date: Aug 2007
Posts: 80
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Google Analytics Problem..

The reason I don't think it was working before is because when I went to my google analytics control panel, it had a message telling me that the code wasn't installed.

But after inserting the code as described by Dezina the message changed and it told me it was gathering the information.

With regard to the SSL problem, are you saying that removing the code I put in manually, it will solve this problem?

Thanks
Arkie....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 14-01-2008, 09:01 AM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,347
Thanks: 3
Thanked 87 Times in 87 Posts
Default Re: Google Analytics Problem..

You need to remove the two unneeded bits of GA code and leave the php code that came with the mod.

The reason that Google didn't show it as installed initially is because someone has to visit your site before Google knows the code id there, and even when they do, there's a bit of a time lag before GA confirms a hit.
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Analytics eCommerce Tracking Module Lawrence PHP/HTML/CSS/JavaScript and Servers 2 22-10-2009 10:53 PM
How to add Google Analytics to every page on your osCommerce store Lawrence Zen Cart & osCommerce 12 09-02-2009 02:29 AM
Problem with Google Checkout Payment Gateway. percept08 PHP/HTML/CSS/JavaScript and Servers 1 06-06-2008 06:42 AM
5 Differences Between Google.com & International Google Search Results SEOBook SEO and PPC 0 29-09-2007 08:25 PM
google analytics Tinkerbell PHP/HTML/CSS/JavaScript and Servers 1 27-08-2007 04:03 PM

Google
Home - Top

Edible Graphics, Affordable E-Commerce, Web Shops & Custom Form Scripts
Gadgets online
tech news, product reviews, the latest home and business technology, the latest in digital imaging


Content Relevant URLs by vBSEO 3.0.0