Using Google Analytics with the script
  • Hi

    I am having problems tracking my web pages that have the comments script on them, I want to track them with google analytics.

    I have found that pages without the comments script are tracked but the ones with it aren't.

    It has something to with this: <?php include_once("analyticstracking.php") ?>

    Does this command conflict with the comments script?

    Thanks for any help.
  • That is standard PHP include function (include once) and it is not in conflict with our script, but contents of your "analyticstracking.php" file might be. As I don't know what's inside your file I can not tell you anything about it, but standard (official) JavaScript tracking code for Google Analytics should not be in conflict with our script.
  • Thanks for your reply, this is the contents of the tracking script:


    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"));


    try {
    var pageTracker = _gat._getTracker("my account id here");
    pageTracker._trackPageview();
    } catch(err) {}

    Just thinking about it I also use a ratings script on the same page as the comments script, the ratings script uses a sql lite database:


    google.load("jquery", "1.3.2");

    <?php include('../rating/rating.php'); ?>

    Well not sure if any of this helps, maybe I should try removing that first and see if I can get the tracking script to work.

    Thanks

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!