Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    help question Google Analytics

    I'm looking to add the google analytics code to my zen-cart installation.

    Since I found 2 different locations on google,

    "just before the closing </head> tag"
    and

    "after the opening <body> tag"
    I started look at this forum for advice.

    Since looking here, I've noticed some people are using mods available for download on this site.

    My questions are:

    1. Which location is best for the analytics code in a zen-cart install?

    and

    2. What is the difference between using a mod like Berezin's "Google Analytics Integration" and just the code google gives out ?

    Thanks in Advance

    ~Dave D.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Google Analytics

    You can "hard code" this into includes/templates/YOUR-TEMPLATE/common/tpl_footer.php

    (if the common folder is not in your template, then create one and put a COPY of includes/templates/template_default/common/tpl_footer,php into it... and edit that one.)

    Berezins modules are all clean and well-coded.

    I think his sitemapsXML mod is even better and I believe it has a feature to install that GA code via a field in the admin panel.
    20 years a Zencart User

  3. #3

    Default Re: Google Analytics

    I would suggest 'Google Analtics by Andrew'. It's fairly easy to install and gives you more information than the basic install if you have an ecommerce site.

    I would suggest the best place would be the footer file - includes/templates/YOUR TEMPLATE/common/tpl_footer.php
    but I'm fairly sure it doesn't matter where you put it, its just best practice to put it at the bottom.

    Hope this helps
    Ralph Stirrat
    Nursing Uniforms

  4. #4
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Google Analytics

    Quote Originally Posted by RalphStirrat View Post
    I would suggest 'Google Analtics by Andrew'. It's fairly easy to install and gives you more information than the basic install if you have an ecommerce site.

    I would suggest the best place would be the footer file - includes/templates/YOUR TEMPLATE/common/tpl_footer.php
    but I'm fairly sure it doesn't matter where you put it, its just best practice to put it at the bottom.

    Hope this helps
    I agree this is the best module, but the line of code should go in main_page.tpl rather than the footer, so that it is on all pages (the footer can be disabled on pages) and it is correctly (as Google recommends) right before the closing </body> tag.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  5. #5
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Google Analytics

    I decided to go with the regular code for a while before switching to the mod. I'm a big fan of Andrews mods too.

    I placed the code on the mainpage.tpl before the closing body tag, but oddly enough in Google Analytics they specify this:

    Code:
    "after the opening <body> tag"

  6. #6
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Google Analytics

    http://www.google.com/support/analyt...n&answer=66983

    Step 4 - Add the tracking code to your pages Back to Top

    Add the tracking code to your pages

    Google Analytics only tracks pages that contain the Google Analytics tracking code. You'll need to add this code to each page of your site, either manually or through the use of includes or other methods.

    To access your tracking code:

    1. Sign in to Google Analytics.
    2. From the Analytics Settings page, find the profile for which you would like to retrieve the tracking code. Please note that tracking code is profile-specific.
    3. From that profile's Settings column, click Edit.
    4. At the top right of the Main Website Profile Information box, click Check Status.
    5. Your tracking code can be copied and pasted from the text box in the Instructions for adding tracking section.

    Basic installation - Copy and paste the code segment into the bottom of your content, immediately before the </body> tag of each page you are planning to track. If you use a common include or template, you can enter it there.
    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  7. #7
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Google Analytics

    Here is a screenshot of what i'm looking at in google analytics:
    Attached Images Attached Images  

  8. #8
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Google Analytics

    Well, I can say for certain when we were having tracking issues for a big Adwords account, the Adwords tech insisted we insert if directly above the closing body tag.

    This appears to be very important for conversion tracking


    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  9. #9
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Google Analytics

    I gonna stick with your advice on this topic.

  10. #10
    Join Date
    Mar 2010
    Location
    UK
    Posts
    445
    Plugin Contributions
    0

    Default Re: Google Analytics

    The standard code should go somewhere near the end of the page. There's just one chunk of code to add.

    The new "asynchronous" code version has two parts. For that new code it is important where the two pieces go.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Google Analytics
    By lukey in forum General Questions
    Replies: 1
    Last Post: 4 Jun 2010, 05:33 PM
  2. Google Analytics
    By honrheart in forum General Questions
    Replies: 3
    Last Post: 11 Jun 2009, 11:44 PM
  3. Google analytics
    By SDC in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 14 Nov 2007, 04:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg