Analytics Code

Discussion in 'PHP' started by herpsuk, Sep 2, 2006.

  1. #1
    hiya guys

    well i want to add google analytics code into my phpnuke site to track it, iver added it to the index and some others after the php but it doesnt work, so how would i go about adding it into the phpcode of the index?

    thanks

    Jonathan
     
    herpsuk, Sep 2, 2006 IP
  2. skimmy

    skimmy Peon

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I"m not particularly familiar with PHPNuke but isn't it comprised of HTML template files (ie: footer.tpl, header,tpl, etc?). If that is the case you can just add the analytics code to the footer file and it will appear on every page.
     
    skimmy, Sep 2, 2006 IP
  3. jhona

    jhona Peon

    Messages:
    96
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    do you place your code in between head tags?

    
    <head>
    Analytics
    </head>
    
    Code (markup):
    just like that.. well if yes.. try to read the help page of analytics. :)
     
    jhona, Sep 2, 2006 IP
  4. smatts9

    smatts9 Active Member

    Messages:
    1,089
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    88
    #4
    You want the code to go across the entire site so you can track it all, so put in a footer file.
     
    smatts9, Sep 2, 2006 IP
  5. Mind_nl

    Mind_nl Peon

    Messages:
    95
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The Analytics code has to be put at the very end of your page/footer file just before the </body> tag. Like this:

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-xxxxxx-1";
    urchinTracker();
    </script>
    </body>
    </html>
    Code (markup):
    (But be sure to copy the exact code from your analytics account and not from this post as it also contains your unique tracking number)
     
    Mind_nl, Sep 3, 2006 IP