Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Jan 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: Google Analytics javascript placement

    Quote Originally Posted by coucho View Post
    You can add the code to the header code too.
    Great! Thanks!

  2. #12
    Join Date
    Jul 2008
    Posts
    56
    Plugin Contributions
    0

    Default Re: Google Analytics javascript placement

    I can use this in the header or should I use the php 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">
    var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
    pageTracker._trackPageview();
    </script>

    or

    <?php include($template->get_template_dir('tpl_footer_googleanalytics.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer_googleanalytics.php'); ?>
    Got Baby Heels? Your Hooter Hider resource!

  3. #13
    Join Date
    Sep 2005
    Location
    Gladstone, Oregon
    Posts
    44
    Plugin Contributions
    0

    Default Re: Google Analytics javascript placement

    I have a subfolder www.wcironsales.com/store

    For some reason I cannot get Analytics to work there, any ideas?

    The index page is: http://wcironsales.com/store/index.php

    The file I have placed the code is in tpl_main_page.php

    The code I placed is:

    <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-6599933-6");
    pageTracker._trackPageview();
    } catch(err) {}</script>

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Javascript window.onload=function placement
    By usr50 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Apr 2011, 10:53 PM
  2. Google Analytics
    By djdavedawson in forum General Questions
    Replies: 10
    Last Post: 23 May 2010, 12:45 AM
  3. Google Analytics
    By muah in forum General Questions
    Replies: 25
    Last Post: 20 Jun 2009, 08:15 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