I don’t know about everyone else but when I am working on a post I tend to refresh the preview page constantly. This adds a bit of bloat to the Google Analytics reports for site traffic. So, here is an easy way to clean up analytics to exclude preview traffic working on a WordPress powered blog or site.
Step 1: Figure out the piece of the URL that distinguishes the preview page from all the other pages or posts on the site.
WordPress makes this one easy, here is an example of a preview page from my site: http://www.matthewsdiehl.com/?p=480&preview=true
I have bolded the key element to setting up this exclude filter. The “preview=true” sets this URL apart from the rest and is what we want to exclude from our reporting.
Now we are off to Google Analytics…
Step 2: When looking at your list of profiles in the lower right hand corner of the screen look for an option called “Filter Manager”. Looks something like this:
Step 3: Click the “+ Add Filter” button in the upper right hand corner of the filter list table. Looks like this:
Step 4: Set the following fields like so:
Filter Name: Exclude Preview Traffic
Filter Type [pull down]: Custom filter
Filter Type [radio buttons]: Exclude
Filter Field [pull down]: Request URI
Filter Pattern: preview=true
Case Sensitive [radio buttons]: no
Then add the profiles this filter should be applied to.
The filter should look like this:
Now save changes and you are done!