Find Internal Links With Campaign Parameters With Screaming Frog
Campaign tracking is a great way to keep track of how much traffic you are sending to your website from external sources (Facebook posts, referral sites, etc.). With Campaign tracking, we append a few query parameters to URLs that point to our website. Those parameters tell Google Analytics information about where that link was posted. This is information that only we know, like which email campaign did this come from or what particular Facebook Ad sent them to your site.
There’s a huge, huge caveat with campaign parameters. We should never use campaign parameters on links on your website to your own website. If you have done this, or are not sure, then follow our steps to help find these links on your site with a tool called Screaming Frog.
A Little Background
Why is it a bad idea to use campaign tracking on links within your website? We actually wrote a blog post already that covers that topic. When Google Analytics sees someone arrive with campaign parameters, it will end the current session and start a new session with the new information. This can lead to tricky issues when trying to determine which channel should get credit for a purchase or goal conversion.
Here’s an example: if a user comes to your site via a paid search ad, their session is now labeled as Source/Medium = “google / cpc.” Let’s say they then they click on a link on your website to go to an internal page also on your website and being tracked with the same GA property, and that link has campaign tracking parameters on it such as this:
… their original session will end and a new session will start. This new session will have a Source/Medium = “mydomain.com/ mainNav” and all behavior from that point forward will be credited to that traffic source. Should that user complete a goal, then inside of Google Analytics, the “channel” that will receive credit for the goal will not be paid search – it will be the campaign you see in the link’s campaign parameters.
Using campaign tracking parameters on internal links makes channel attribution really difficult, in the default reports and also within the Multi-Channel Funnel reports. In most cases, you’ll want to use event tracking to track clicks on internal links instead.
So, let’s find any potential issues and correct them!
What is Screaming Frog?
Screaming Frog is a great tool for investigating various aspects of your website by crawling through the files. It is a tool used often by those in the SEO industry, but we can take advantage of its strength for analytics purposes as well.
We have another great blog post that provides a little background on Screaming Frog as well.
Finding Internal Links with Campaign Tracking Parameters
To have Screaming Frog crawl your website, you need to enter your domain in the search bar and hit “Start.” We’re going to update a couple of settings before we do that though.
First, go to Configuration > Custom from the main navigation.
This is where we will add a filter that will allow us to search for any pages on our website that have campaign tracking parameters. Using the Custom option will return a list of URLs, which we can then investigate to see where the links exist on those pages.
In the Custom window, add the following line to the first filter condition:
This tells Screaming Frog that we want it to search for pages that contain any string of text that matches that regular expression (yes, you can enter regular expressions here even though the condition is “contains”). Note that here we’re expecting the medium to follow the source param, but you might want to just search for one of the parameters if you’re unsure how they might be implemented across your website.
Now we can run our crawl. Any results of the crawl will start to appear in the table below, such as this:
Click on any one of them to see more details. You can copy the address of one of the pages that were found and navigate to them in your browser to inspect further.
One example from our website is the blog post on “Campaign Tracking using _setAllowAnchor” which has a couple examples of how campaign parameters look on a URL:
This is alright, because we’re not actually linking anywhere – it is just a text example on one of our blogs.
You may find that you have to check the source code to see where the parameters are used in links on your webpages. For example, if there is an actual link on a page on your site that has campaign parameters, they likely won’t appear visually for the user. You’ll have to check out the source code and look for those links.
View the source of the page and then search (CTRL + F) for “utm_” to find any links, to your own site, that have the campaign parameters on them.
If they are in place on links to pages on your website, you will want to remove them and potentially add event tracking for those links.