In follow up to our Referrer Spam, Part 1 article on how to identify referrer spam, we’re providing information on how to eliminate referrer spam from your analytic reports in this one.
There are a couple of ways you can eliminate referrer spam. You can either block it from hitting your web server or filter it out of your analytics reports/views.
Blocking spam from reaching your website server altogether requires updating your .htaccess file that is found in public html directory of your web server. Changes to this file will block all future referrer spam but will not affect what has been reported in the past. Code can be added to your .htaccess file as supplied by SEOprofiler (download here) or you can grab it here (compliments of Perishable Press). You’ll have to update your .htaccess file periodically as new referrer spam is identified.
Make a back up copy of your website before changing your .htaccess file and be careful updating it. If only one character is out of place in the code it could cause your website to go down. If you don’t feel comfortable changing it yourself you should contact your Webmaster.
When you apply a filter in your analytics program, the spam still exists but is filtered out of your reports. We tested a filter recently and here’s how we set it up on our Google Analytics account:
2. Over to the far right you should see your website URL under the heading “View.” Click the down arrow next to your URL and select “Create New View.”
3. Make sure “website” is selected and enter a name for your view. The name can be anything like “No Spam,” “Spam-free,” etc. We named ours “My Hosts” because we’re going to create an “include only” filter that includes our legitimate URLs. Set your time zone and hit “Create View.”
4. Now you’ll see a new view name show up under the “View” heading. Note ours says “my hosts.” Find the “Filters” link below the view name and click it.
5. Now click “+Add Filter.”
6. A new window will open to allow us to define our filter. Click “Custom” to create a custom filter type. Check include, select “host name” from the Filter Field drop down. Enter the “Filter Pattern” of “yourwebsite\.com|www\.yourwebsite\.com” filling in “yourwebsite” with your URL. We entered “wcmarketingsolutions\.com|www\.wcmarketingsolutions\.com.” If your URL is case sensitive then check that box. Our URL isn’t so we left it blank. Hit “Save” at the bottom of the window.
7. After you save you’ll be reverted back to the screen to add a filter and you’ll see the name of the filter you just created.
As mentioned above regarding changes to the .htaccess file, creating filters only changes your reporting data going forward and does not change the traffic information already presented. Check your traffic reports in a couple of days to see if your filter is working.
From now on, make sure your view is set to your new filtered view (ours is my hosts). To check how the filter is working, follow the same steps we outlined in Part 1 of this series.
2. Let’s check the Referral category under Acquisition/All Traffic/Channels and click “Referrals.”
3. It looks like six referral spam hits made it through but it’s much better than we saw previously with over 1,300 of them.
4. We’ll try to get rid of this last one by creating another filter to add to our “my hosts” view.
5. This filter was set up similar to the filter outlined in Step 6 except that we are excluding “top1-seo-service\.com|www\.top1-seo-service\.com” instead of including “wcmarketingsolutions\.com|www\.wcmarketingsolutions\.com.”
In addition to the .htaccess file changes and filter information listed above, we are also testing a couple of additional options identified below. We may have to write a Eliminate Referrer Spam, Part 3 article in the near future to report how our additional testing goes.
We found a company (Loganix) that created a Google Analytics segment (instead of filter) to protect your site from referrer spam and ghost traffic. It’s easy to sign up, download the segment and add it to your Google account. The great thing is that Loganix will keep the segment updated on a weekly basis with any new referral spam that’s been identified. All you need to do is get a new copy of it each week and add it to your Analytics account
Another option we’re testing now for WordPress websites is a plug in called Block Referer Spam by codestic. While there were several plug-ins to choose from, we started with this one since it had a high rating (4.1 out of 5), over 1000 downloads and had been updated recently.
Please comment with any questions you have or fixes you have tried to help you eliminate referrer spam. We’d love to hear from you.
Wow, I had no idea that all this referrer spam was in my Google Analytic Reports. Thanks for the help
These instruction were very informative and helpful. I didn’t realize that I had so much referrer spam getting thru. Thanks!