Trying to remove your traffic from Google Analytics when you have a dynamic IP address can be frustrating, but here is a great way to clear up some (if not all) of that traffic – with a custom campaign. By using a custom campaign, we can track and remove the matching campaign traffic from our view.
Create A Custom Campaign
The first thing that you’ll want to do is create new and unique campaign variables to track internal traffic. For our example, let’s use the following:
- Domain Name: (insert page url here)
- Campaign Source: internal
- Campaign Medium: referral
- Campaign Name: Internal Traffic
Build Your Tracking URL
Next we’ll want to create our tracking URL – we will use the URL Builder Tool to create our custom-tracked URL. To use the tool we’ll have to also add information for the required Medium, Name, and Source fields, so fill those in as you wish.
I continued with the Internal theme for name, and since this is a referral I chose that as my source.
Create Our Filter To Ignore Internal Traffic
Our third step is to create a filter to ignore our traffic. Inside of your Analytics, click to add a new Filter.
Analytics will only let you add one filter at a time, so let’s filter on our original variable, Campaign Source. Select a Custom Filter Type, with your Filter Pattern of “internal”
Test Our Filter For Ignoring Internal Traffic
With our new filter saved and live, let’s open a webpage with our new campaign tagged URL, and see if we are visible in Real-time Analytics.
Great – we can see that our page views aren’t loaded in Real-Time Analytics, which means our campaign filters are properly set up. Congrats, but there is more work to be done! The all important final step!
Update URL’s For Bookmarks, Intranet – Everywhere!
With our new URL in hand, we need to have people start using it so that they won’t be counted in our Analytics. It’s a good idea to update links everywhere you can – on an Intranet, staff bookmarks, a custom homepage – anywhere an internal user could click to visit our site.
Remember, this method isn’t as iron-clad as removing internal traffic from Google Analytics with an IP filter, but if we remove any portion of our internal traffic, we still have cleaner data than before. And, we can also create a custom segment in Google Analytics with our Campaign variables to see how much traffic we are cleaning up.
Hi Greg,
Thanks for your post. I have read many articles and ideas around blocking internal dynamic IP addresses and whilst many have their pro and cons, your ideas sounds the most promising and simplest for my needs.
My question for you is, when building the tracking URL as you suggested, does this only exclude counting internal traffic that only visits the root domain or does it exclude the visitor, regardless if they were to click around throughout the whole website?
Appreciate your guidance.
Hi John,
This will exclude any visitor that visits that link, and any pages they visit. For what it’s worth, Google Analytics sessions will time out after 30 minutes of inactivity, so it’s possible for someone to click the tracking link, leave the page open for over 30 minutes, and then get a new Analytics tracking cookie. You do bring up a good idea and I may rewrite a portion of this blog to use a custom dimension and a user cookie which is much more durable and won’t suffer from the 30 minute timeout. I’ll write you back when I have that update. Thanks and I hope this helps!
Found this post via Reddit, thanks for sharing it!
Although the concept sounds interesting to me, im still not quite sure what the true purpose of excluding internal traffic might be. For example, would this be helpful to better measure your websit’es traffic stats? only showing the traffic that truly matters? If this is the case, i might put this tutorial to use.
Thanks again!
Elvis
Hi Elvis! Thanks for the comment!
You had the reason exactly right – as users of our own sites, sometimes we will browse and test our own site. Some website CMS’s and plugins (like WordPress and Yoast’s Google Analytics) simply won’t count your visit if you’re logged in – but that means you have to be logged in for that to happen. By using this campaign method, your traffic (or anyone who uses the link) would be ignored.
Thank you for the great tip, Greg. Will definitely set it up.