WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics and WordPress (4 posts)

  1. Garrett Cobarr
    Member
    Posted 3 years ago #

    I hope there are some people here who have installed Google Analytics in their WordPress sites because the information at Google Help is about as scanty as it can get. I have posted a question at their forum but nothing so far.

    I successfully installed the code in my header.php file and the report is coming in loud and strong. Then I realized I am a large part of the statistics.

    So I followed their directions, on how to Exclude traffic. The easiest first step is creating a filter for an IP address. Did that for my laptop and desktop at my office which has static IP addresses. That did work.

    It gets a bit more complicated when you need to establish a cookie on your computer to insure that you are filtered in a dynamically assigned IP network. They state, "1. Create a new page on your domain, containing the following code:" and the code:
    <body onLoad="javascript:pageTracker._setVar('test_value');">

    As you can see I placed this line of code right after the other Google code in my header.php but this is not working. I am getting an error in my browser's debug,"ReferenceError: Can't find variable: pageTracker"

    Their statement suggests that I need to create a page and visit it but this sounds like they mean a static page and of course, WordPress is dynamic.

    Any thoughts? Boy, I need help on this.

    Thanks

  2. Brayne
    Member
    Posted 3 years ago #

  3. Garrett Cobarr
    Member
    Posted 3 years ago #

    Thanks for the tip Brayne, but this does not help my central problem. That being the successful installation of a cookie to keep me out of the statistics, or does it?

  4. I successfully installed the code in my header.php file and the report is coming in loud and strong. Then I realized I am a large part of the statistics.

    I use this one

    http://wordpress.org/extend/plugins/google-analyticator/

    And in the admin page for the plugin under "Track all logged in WordPress users:" select No. That way all you need to do is log into your WordPress blog and you will not be tracked.

Topic Closed

This topic has been closed to new replies.

About this Topic