Back to all articles

Combat GA4 Spam Referrals: A Comprehensive Guide

19 min read

The accuracy and integrity of your website data is crucial for making informed decisions about your online presence. Recently, a significant surge in spam referrals, particularly from sources like “news.grets.store,” has posed a significant threat to data integrity in Google Analytics 4 (GA4). This comprehensive guide, is meant to help you combat GA4 spam referrals. Below, we walk you through identifying, blocking, and ensuring your GA4 data remains unaffected by these unwanted referrals.

The Rise of GA4 Spam Referrals

GA4 spam referrals dramatically skews your analytics because they result in inflated traffic numbers that are not legitimate visitors. Such anomalies distort understanding of your site’s performance but can also result in misguided strategic decision-making.

Sample graph of questionable user activity to research for potential GA4 Spam Referrals
Sample graph of questionable user activity to research for potential GA4 Spam Referrals

History of Analytics Spam

Spam referrals have long challenged webmasters and digital marketers, not just in Google Analytics 4 but also in its predecessor, Universal Analytics (UA).

Users of UA frequently faced various types of spam, such as ghost referrals, crawler spam, and fake events. All muddied analytics data and made tracking authentic website engagement and performance more complex. Webmasters and analysts were constantly filtering out this deceitful noise to ensure data truly reflected real user interactions.

Notably, ghost referrals, bypassed websites entirely, sending fake data directly to Google Analytics servers. This allowed spammers to create the illusion of traffic from non-existent or malicious sources without accessing the site. Crawler spam, on the other hand, originated from bots that actually visited websites, leaving a trail of false data. Webmasters and analysts were constantly filtering out this deceitful noise to ensure data truly reflected real user interactions.

The fight against referral spam has prompted the development of several mitigation strategies, such as establishing filters, creating segments to weed out known spam sources, and introducing a hostname verification feature in Universal Analytics. However, as spammers’ tactics grew more sophisticated, these defensive measures required continual updates.

The transition from Universal Analytics to Google Analytics 4 has brought new challenges for spam detection and prevention.

Identifying GA4 Spam Traffic

Regular monitoring of your referral traffic is key to spotting unusual spikes that indicates spam. Spam is often characterized by an unusually high volume of traffic from a single source and there is often little to no engagement, such as session duration or pages per session.

GA4 Spam Referral clue: Graph showing user stickiness isn't consistently trending with the increase in traffic.
GA4 Spam Referral clue User stickiness isnt consistently trending with the increase in traffic

Finding the Spammers URLs Sending the GA4 Spam Referrals

A list of top referring domains shows 8 out of 10 GA4 spam referrals!
A list of top referring domains on a low traffic website shows 8 out of 10 potential GA4 spam referrals

Create a report to display all referring domains in order to find any suspicious URLs. Google may have created a report like the one above automatically, if you migrated from UA to GA4 in 2023. Otherwise, Google Analytics 4 involves several steps in the new interface to track and analyze where your traffic is coming from.

Here’s a detailed step-by-step guide designed to assist you in creating this report:

Step 1: Assuming you are logged into your Google Analytics 4 Property

  • Navigate to the correct account and property you wish to analyze.

Step 2: Access the Analysis Hub

  • In the left sidebar menu, click on “Explore.”
  • This opens the Analysis Hub, where you can then create custom reports.
GA4 Explorations tab or Analysis Hub View

Step 3: Create a New Exploration

  • Next, click on Start a new Exploration or “+New Exploration” to begin building your report.
  • Your action opens a new, blank exploration template.
GA4 new blank report

Step 4: Choose the Type of Exploration

  • In order to discover all referring domains, a “Free Form” and “Table” (Visualization icon) exploration type is typically most useful.
  • Then select the exploration type to proceed with the setup.

Step 5: Set Up Your Dimensions and Metrics

Choosing Dimensions for GA4 Spam Referral Report
Choose Dimensions
  • Dimensions: These are attributes of your data. For referring domains, you’ll want to first add dimensions related to traffic sources. Choose “Session source / medium” as your dimension.
  • Metrics: These are the quantitative measurements. Secondly, add “Sessions” metrics to see how often a referring domain is sending visitors to your site.
Choose Metrics for GA4 Spam Referral Report
Choose Metrics

Step 6: Configure Your Dimension and Metrics

  • Finally, drag and drop the chosen dimensions and metrics into the “Rows” and “Values” sections, respectively.
  • For referring domains, place your dimension (e.g., “Session source”) in the “Rows” section and your chosen metrics in the “Values” section.
Final spam sources report for GA4 Spam Referrals review

Step 6: Review and Analyze the Data

  • Once your report is set up, analyze the data to gain insights into which domains are referring traffic to your site.
  • Review any suspicious looking domains like the news.grets.store domain in the first position above and several others below google/organic and (direct) / (none).

Step 7: Save and Share Your Report

  • Save your exploration by clicking the “Save” button and giving it a meaningful name.
  • You can also share your report with others by clicking the “Share” button and following the prompts.

Additional Tips

  • Regularly update and review your report to keep track of potential GA4 spam referrals.
  • Combine other metrics and dimensions in this report for additional analyses.

Steps to Block GA4 Spam Referrals

UPDATED: 02/27/24

The methods for blocking specific referral domains and filtered segments were not as successful as we’d hoped to filter out the ghost visits by tag spammers. I’ve left them here (lower on the page) so you can review and see what was tried.

In the era of Universal Analytics, blocking unwanted traffic from our analytics was straightforward, as demonstrated in the image below.

How Universal Analytics allowed us to block visitors to the website.

We could easily exclude visits by our team or others to prevent skewing client data. However, with the transition to Google Analytics 4, this direct blocking feature was removed, and is now challenging us to devise new, innovative methods to filter out undesired traffic.

The following solution comes as an enhanced recommendation from James Gray, developed in partnership with Nicholas Martinez. As a token of appreciation for their investigative efforts, consider following connecting through their Linkedin newsletters. ”

This “Combat GA4 Spam Referrals: A Comprehensive Guide” aims to elaborate on the solution they provided, specifically targeting areas that may be confusing for those of you new to Google Analytics and Google Tag Manager. I hope it helps with clarity and understanding of the steps.

If you need further assistance, don’t hesitate to reach out.

How to Use Google Tag Manager to Block GA4 Spam Referrals

Since the offending spammers don’t actually visit your site, instead they ping your Google tag. These types of spam referrals are also called “ghost visits.”

Complete the following steps to attempt to block GA4 spam referrals from impacting your analytics:

Step 1: Login to Google Tag Manager (GTM)

Visit https://tagmanager.google.com/ , login if necessary, and ensure your website is showing in the workspace dropdown. If your website is displayed in place of www.cybercletch.com, you can skip the next step.

Google Tag Manager view with a website associated
Google Tag Manager with a website associated

If there isn’t a website showing, you need to connect Google Analytics to Google Tag Manager to move forward with the solution.

Google Tag Manager without a website associated
GTM without a website associated

Step 2: Associate Google Analytics with Google Tag Manager

Starting with GA4, navigate to the Admin screen (Step 1 in image) and find the Data Streams (Step 2 in image). Selecting a stream reveals detailed settings, including your Google tag configurations.

Image showing Step 1 and Step 2 in GA4 settings.
Google tag admin showing View Tag instructions
Scroll down the page to the Google tag section and click on View tag instructions

Begin by following GTM’s setup instructions to link your website and analytics to the upcoming tag exceptions.

This process involves embedding specific code snippets in the <head> section and immediately after the opening <body> tag on every page of your site. How this is done may vary depending on how your site is built and available plugins. Alternatively, installing Google Site Kit plugin could simplify this integration, potentially streamlining the setup process for you.

Once complete, move onto the next step.

Step 3: Create a New Variable in Google Tag Manager

In the GTM Workspace, click the Variables link on the left navigation column.

Screenshot of Steps in the Tag Manager Workshop to create a new User-defined variable.

Scroll down to User-Defined Variables and look for the New button on the right. The following window opens. I adhered to recommended naming conventions and titled this action Referrer Hostname.

Screenshot of the Variable window
  • Click the edit pencil to choose a variable type. Choose HTTP Referrer from the list.
  • Change Full URL to Host Name
  • And select Strip www.
Screenshot showing settings fir the Variable Configuration as part of GA4 Spam Referrals blocking

Click the Save button to finish the piece of the process.

Step 4: Set up Trigger

It’s time to pull the Trigger! In the GTM Workspace, click the Trigger link on the left navigation column.

Screenshot of Google Tag Manager Workspace with steps for setting up a Trigger in order to block GA4 Spam Referrals

The new window opens. Following James guidance I named the task Block Ghost Traffic Trigger and clicked the pencil icon in the top right corner to create the trigger.

Screenshot with Trigger configuration and where to find the edit icon.

A menu opens on the right side of the screen with several types of triggers to choose from. Depending on whether you’re a seasoned GTM user or a novice, you may not know there are more than one type you can choose in this instance dependant on your setup and circumstances.

GTM’s page view triggers are essential for firing tags based on specific page load events. With five distinct trigger types, each prioritizes differently, ensuring tags fire at the appropriate stage of page loading.

For instance, the ‘Initialization’ trigger fires first, setting the stage for any subsequent triggers, while the ‘Page View’ and ‘DOM Ready’ triggers cater to immediate page load data and interaction-ready moments, respectively. I followed basic instructions and chose the Initialization trigger.

Google Tag Manager screenshot with a list of triggers to choose from.
Types of Triggers in Google Tag Manager

Once the Initialization trigger is selected, there are a few other choices to make.

  • Some Initialization Events
  • Referrer Hostname

The following selections are based on which websites are spamming your site. If there’s only one URL you’d like to block, the middle drop down can remain as “contains” and then place the URL in the third box. In the event there are multiple sites, choose the settings below

  • matches RegEx (ignore case)
  • and then place the list of sites to block with a ” vertical line” or “bar” between them.
  • Save

Here is my list from client stats: news.grets.store|info.seders.website|kar.razas.site|trast.mantero.online|game.fertuk.site|garold.dertus.site|ofer.barikus.site|rida.tokyo|static.seders.website

I was able to get this list from the referring domains list mentioned near the start of this blog post.

GTM Trigger Configuration screenshot as part of Blocking GA4 Spam Referrals

Step 5: Putting it all Together to Block GA4 Spam Referrals

Head back to the GTM Workspace and select Tags from the left side navigation. You may already have a tag here you can use, but if you don’t, it will look like the screenshot below. Open an existing tag or click New.

Screenshot of where to connect the GTM tag and trigger using the New button.

Click anywhere within the Tag Configuration box to open a window. Subsequently, if you already had a tag that will already be listed and you can move onto the Triggering window.

Screenshot of set up of a GTM tag and trigger for the purpose of blocking GA4 Spam referrals from your analytics.

The following window opens where you can choose which tag makes sense for your situation.

Choose Option 1 if your tags are not connected to Google Analytics yet

Choose Option 2 to create a new Google tag.

Tag Configuration screenshot with Tag ID input empty.

Click the ? to understand and find the Tag ID you need to input.

Once that is set up, return to the Triggering portion (below tag configuration). Here is where we put it all together!

Screenshot of Triggering area

Click within the triggering box to see the following choice. Select your previously chosen trigger type. Mine was Initialization – All pages.

Screenshot showing the

Once you select Initialization – All Pages, you’ll then be able to select “Exceptions”

Screenshot of the Triggering window with "Add Exception" link

Click “Add Exception” and select your previously named Trigger. I named mine “Block Ghost Traffic Trigger” as suggested.

When done, your Tag Configuration page should look similar to the screenshot below:

Screenshot of Tag configuration, Triggering and exception
Remember to name and save as required

The final step is to click on Submit to publish your work, if it is not already live from using a previous tag.

Screenshot of where to find the Submit button to save and publish tags and exceptions for use to block GA4 Spam Referrals

If you used an existing tag, you’ll have the option to save this as a “version.” I recommend doing so in case something goes wrong and you want to roll back the work you completed to the previous version. As always, keep an eye on the statistics to see if it’s performing and doing what you expect.


Previous Attempts to Block GA4 Spam Referrals (aka Ghost Spam) Tried:

Blocking GA4 spam referrals involves multiple steps within the GA4 admin interface. Follow these steps to ensure unwanted visitors do not pollute your analytics data.

Blocking Specific Referral Domains

  1. Navigate to GA4 Admin Settings: Login to your GA4 account, then click on the admin settings in the bottom left corner.
Image showing Step 1 and Step 2 in GA4 settings.
  1. Locate Data Collection and Modification Settings: Click on Data streams
  2. Locate Your Targeted Data Stream: Under the ‘Data Collection and modification’ tab, select your data stream. The next window will open as shown in the following image.
  3. Web Stream Details: Then select ‘Configure tag settings’ under the Google Tag section.
Screenshot of step 4 and where to select Configure Tag Settings
  1. Google Tag: Select List Unwanted Referrals in the Settings section of the page. Note you will need to expand the ‘Show More’ selection to see this option.
Step 5 screenshot of List unwanted referrals
  1. Exclude Unwanted Referrals: In the ‘List unwanted referrals’ option, input the domain you wish to block, such as “news.grets.store”, to prevent any future traffic from this source from being registered.
Screenshot of Step 6 and how to exclude unwanted referrals in GA4.

According to this Google Analytics Help page, many users are frustrated with the lack of response by Google to this issue. The spam domains listed above are mentioned as well. It’s likely that the engineers behind GA4 are diligently working to understand the root cause and formulate an effective solution before issuing a public statement.

Refining Your Reports with Filtered Segments

Since blocking a domain could redirect it as ‘direct traffic’, creating filtered segments may also help to maintain the accuracy of your reports.

  1. Utilize Explore Mode: In GA4’s Explore mode, either open a new exploration or an existing one to create a new segment.
  2. Create a User Segment: Specify the condition that excludes the spammy domain, to ensure it doesn’t affect your data analysis.
GA4 Spam Referrals: shows how to block a session source.
Create a User Segment that excludes a session source starting with the spammers URL
Screenshot of GA4 User segment summary after attempting to combat GA4 Spam referrals
Of the 7300 users 3400 originated from the blocked domain which severely impacts the analytics accuracy

Advanced Measures for Comprehensive Blocking

For another approach to blocking spam traffic, consider excluding specific IP addresses identified as sources of spam referrals. Basically we are telling Google the visits are from internal traffic and not to count them. You won’t be able to find the user IP addresses in GA4, that’s something you’d have to access via your hosting server reports or through a DNS Lookup tool such as the one I am sharing below.

MX Toolbox DNS Lookup for news.grets.store
MX Toolbox DNS Lookup

Once you have an IP address follow these steps to list it as internal traffic so GA4 doesn’t include it in your data:

  1. Define Internal Traffic: In the ‘Web Stream Details’ section of your GA4 admin settings, find the option to ‘Define Internal Traffic’.
  2. Add IPs to Block: Input the IP addresses associated with the spam referrals to further safeguard your analytics data from these unwanted visits.

Keep in mind that these GA4 spammers are slippery to begin with so constantly changing their IPs wouldn’t be a stretch.

Continuous Vigilance and Reporting

Maintaining the cleanliness of your GA4 data requires ongoing vigilance. Regularly review your referral sources and be prepared to adapt your strategies to counter new spam tactics as they emerge. Reporting spam referrals to Google also contributes to a safer digital ecosystem, allowing for improved spam detection algorithms. Hopefully, they’ll resolve this particular vulnerability soon.

Acknowledgment

Two of these approaches that identify and block spam referrals in GA4 and outlined in this guide were initially highlighted by James Gray on his Linkedin newsletter. Give his newsletter a follow if these steps helped. His quick insights into addressing this issue promptly were invaluable to keeping the integrity of our data.

GA4 Spam Referrals Conclusion

Tell us if “Combat GA4 Spam Referrals: A Comprehensive Guide” was helpful to you! Spam referrals pose a significant challenge to the accuracy of Google Analytics 4 data. By following the steps outlined in this guide, you can mitigate the impact of these unwanted visitors on your analytics. But, keep in mind, you must regularly monitor analytics and use proactive measures to block spam sources. This ensures your GA4 data remains a reliable foundation for your digital marketing strategies. Our digital landscape is continually evolving, and so are the tactics of those looking to exploit it.

Staying informed and proactive is your best defense against the disruptive effects of spam referrals. With CyberCletch as your digital partner, that is ensured!

CONNECT:
FacebooktwitterlinkedinrssinstagramFacebooktwitterlinkedinrssinstagram

SHARE:
FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail