frenchie
frenchie

Reputation: 51937

Blocking referral spam traffic in asp.net without modifying the web.config

I'm using Google Analytics and I'm using filters to remove referral spams. In my web.config file, I also use this:

<rule name="buy-cheap-online.info" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
    <conditions>
        <add input="{HTTP_REFERER}" pattern="*.buy-cheap-online.info" />
    </conditions>
    <action type="AbortRequest" />
</rule>

I have dozens of these rules and I want to add more. There's this file on GitHub that includes a list of spammers: https://github.com/piwik/referrer-spam-blacklist/blob/master/spammers.txt

I could just keep adding rules to the web.config but it seems messy. What's another way to block referral spam traffic in asp.net so that all the sites in the text file can be blocked and if the file changes I can easily add new sites by reuploading the text file?

Note: I'm not asking for code to be written for me; I just want to know what other options I have.

Upvotes: 0

Views: 441

Answers (1)

Carlos Escalera Alonso
Carlos Escalera Alonso

Reputation: 2363

That's right keep adding rules will be messy and even worse useless, most of the spam in GA never reaches your site, there is no interaction at all so any server-side solution like the web.config won't have any effect.

We can differentiate the spam mainly in 2 categories:

  • Ghost Spam that never interacts with your page, so any server-side solutions like the web.config or htaccess file won't have any effect and will only fill your config files with.

Some people still hesitate because they think creating filters is just hiding the problem instead of blocking. But there is nothing to block, it is just some guy making fake records on GA reports.

  • And Crawler Spam as the name imply, they do access your website and can be blocked this way, but there are only a few of them compared with the ghost.

To give you an idea there are around 8 active crawlers while there are more than 100 ghosts and each week increasing. This is because the ghost method is easier to implement for the spammers.

The best way to get rid of all ghosts with just one filter based in your valid hostnames.

You can find more information about the ghost spam and the solution here

https://stackoverflow.com/a/28354319/3197362

https://moz.com/ugc/stop-ghost-spam-in-google-analytics-with-one-filter

Hope it helps.

Upvotes: 1

Related Questions