Sudden Spike In Google Analytics Spam Traffic? Let’s Find Out Why!

July 18, 2017

sudden-spike-spam

Sometimes your Google Analytics data just looks wrong. In fact, sometimes looking at the data – it’s clear that the data you’re seeing could not have been caused by normal users visiting your site. These strange occurrences usually happen for a reason, but you may have to do a little digging to figure out why. Google Tag Manager can help you do this. Let’s go through some examples and possible ways to figure out the solution and one way of fixing it using Google Tag Manager.

Spike in Traffic

If there is a sudden spike in traffic that can’t be attributed to a viral post or expected increase, then it might be caused by spam or bots. There are a number of ways to avoid traffic from the pesky sources, but it’s a constant battle that’ll keep you on your toes.

First Things First

There are some measures you can take to eliminate spam before it ever enters your Google Analytics’ data. Here’s a helpful post on how to filter spam and bots.

There is also an option to exclude most known bots and spiders by simply checking a box in the view settings. Read more about this feature here.

Still See Sudden Spam?

Sometimes you follow the best practices, everything is going smoothly, and then, all of the sudden, there’s a spam spike in your traffic! What went wrong?

spike spongebob

There will always be new spam that will find its way to your site and in your data. Unfortunately, once that spam enters your data, you can’t go back and get rid of it. So keep your eye on your data, set up custom alerts to notify you when there’s a sudden and large increase in data, and hop into detective mode.

General Troubleshooting

If you followed all the guidelines above and still have days with a spike in traffic, start with some general troubleshooting.

Below are some possible clues to examine when narrowing down the perpetrator.

Browser

Check the browser and browser version. If the spam traffic is coming from the same browser or version, you might be able to use an exclude filter on the view. Check to make sure that you won’t be filtering out real traffic though. Look for signs of human life – like varying session durations, goal completions, and more than one page per session.

Hostname Report

Check the hostname report. Is the traffic coming from a specific hostname? Perhaps there’s a really strange hostname or one that is a slight variation of your own hostname. If you don’t already have a filter to include only your site’s hostnames, make one. If you are afraid of missing some of your hostnames with this method, create an exclude filter with all the unwanted hostnames.

Source/Medium and Referral Path

Take a look at the source/medium of your spiked traffic. Do you see an odd source? Some spam might pass through different UTM parameters for source/medium. Is all the traffic coming from the same dodgy-looking referral source? If you have no one reason to trust that traffic, and it appears to be obvious spam, that you might be able to use those dimensions to filter out future spam.

Google Tag Manager

There are two filters that can help in eliminating spam, but configuration in Google Tag Manager is needed first.

Client ID

Spam can also enter your data as the same user, with the same set of unique cookies. If you notice a user coming back to your site again and again with the same client ID, this is most likely spam. Unfortunately, you cannot simply create a filter based on this client ID as it is not available as a dimension. First, you need to create a custom dimension in Google Analytics and use Google Tag Manager or JavaScript to pass through some extra info – like the GA Client ID. You’ll then be able to look for patterns and if needed, filter out specific client IDs that appear to be bad actors.

User Agent

When all else fails, eliminate spam traffic with user agent. User agent is a string that provides information about a user’s system, browser, and browser version. These are fairly specific and unique and therefore a good way of narrowing down and identifying spam.

Similar to client ID, you will need to create another custom dimension. To grab the value of user agent, create a new variable to look like the image below.

Create a new custom dimension in Google Analytics and then add the custom dimension information to all your Google Tag Manager Tags. Now you can filter based on user agent!

In one instance, there wasn’t anything specific I could find about a cause of a spike in traffic, but I noticed that the spam was visiting one page only. I could have filtered that particular page from my data, but there was still some real traffic going to that page. Instead, I filtered by user agent.

If you find a consistent pattern, you can exclude that user agent to prevent that same spam in the future. Just add an annotation explaining the spike in traffic and if it’s significant enough, use a segment excluding all sessions with that user agent to report on previous days.

Conclusion

Eliminating spam is a never ending battle, but it you manage to spot it quickly and find the culprit, it’s possible to stay on top of it. All you have to do is find something unique about that spam and create a new filter. This will help keep you current and future data as clean as possible.