Title: Google Analytics and WordPress
Last modified: August 19, 2016

---

# Google Analytics and WordPress

 *  [Garrett Cobarr](https://wordpress.org/support/users/garrett-cobarr/)
 * (@garrett-cobarr)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-and-wordpress/)
 * I hope there are some people here who have installed Google Analytics in their
   WordPress sites because the information at [Google Help](http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55481)
   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](http://pastebin.com/8RtQprju)
   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](http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55481),
   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](http://pastebin.com/8RtQprju) 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

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Brayne](https://wordpress.org/support/users/brayne/)
 * (@brayne)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-and-wordpress/#post-1856176)
 * [http://wordpress.org/extend/plugins/google-analytics-for-wordpress/installation/](http://wordpress.org/extend/plugins/google-analytics-for-wordpress/installation/)
 * [http://wordpress.org/extend/plugins/google-analytics-dashboard/](http://wordpress.org/extend/plugins/google-analytics-dashboard/)
 *  Thread Starter [Garrett Cobarr](https://wordpress.org/support/users/garrett-cobarr/)
 * (@garrett-cobarr)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-and-wordpress/#post-1856350)
 * 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?
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [15 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-and-wordpress/#post-1856352)
 * > 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/](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.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Google Analytics and WordPress’ is closed to new replies.

## Tags

 * [cookie](https://wordpress.org/support/topic-tag/cookie/)
 * [header.php](https://wordpress.org/support/topic-tag/header-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-and-wordpress/#post-1856352)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
