3

I've added below rewrite rule to my web.config. It has worked perfectly, blocking all mentioned referral spam sites. However, today suddenly I noticed that social-buttons.com popped up in my Google Analytics. How is this possible with the rule I have defined below?

    <rule name="abort referer spam requests" stopProcessing="true">
      <match url=".*" />
      <conditions>
         <add input="{HTTP_REFERER}" pattern="(semalt\.com)|(buttons\-for\-website\.com)|(simple\-share\-buttons\.com)|(darodar\.com)|(social\-buttons\.com)" />
      </conditions>
      <action type="AbortRequest" />
    </rule>

1 Answer 1

5

I had the same problem.

social-buttons.com is like darodar.com

they are using your Google Analytics Code to recreate fake information and sending that directly to Google Analytics.

So you cannot do anything with {HTTP_REFERER} to stop it.

The only you can do from (.htaccess) is to block the ip of the visitor who run the script in your site.

But in few minutes he can change his IP and do it again.

(if he enter in your site, more times they just hitting tracking ID UA-000000-01 remotely)

More information you can find in this site.

A smart technique to test your refferal blacklist in htaccess is to install a blackhole trap to your website and in your (.htaccess) to put the following:

RewriteCond %{HTTP_REFERER} social-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} darodar\.com [NC,OR]
//all other refferals you have..

RewriteCond %{HTTP_USER_AGENT} ^libwww-perl [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^libwwwperl [NC]
//all other bad user agents you have..
RewriteRule ^(.*) http://your website/_path_to/blacktrap.php 
// and send them to your trap`

So you will be informed for all the bad refferals or bad agents you will catch.

Also you can use the following technique:

(phpbook.net/how-to-log-ip-adresses-in-php.html)

to log all the ip's that enter to you site.

So to understand where is the problem.

But you will not find refferal from (social-buttons).

Use your google analytics settings to stop it:

METHOD-1

through filters

Step 1 Open Google Analytics | —–> Go to Admin tab | —–> View column | —–> View settings | —–> Bot Filtering

check the box Exclude all hits from known bots and spiders

| —–> View column | —–> Filters | —–> NEW FILTER | —–>

filter name: (the name of your filter)

filter type: custom / exclude

filter field: campaign source

filter Pattern: like the following example

.*semalt\.com|.*kambasoft\.com|.*smailik\.org|.*buttons-for-website\.com|.*o-o-6-o-o\.com|.*makemoneyonline\.com|.*s.aliexpress\.com

and click save

Step 2 create a new view segment to filter out unwanted spam referrals more info: (http://www.analyticsedge.com/2015/01/advanced-segment-eliminate-spam-referrals/)

you can use the following template https://www.google.com/analytics/web/template?uid=hKkT2kdWQpG00jQxbT6p8Q

and chage it to your needs

METHOD-2

Open Google Analytics | —–> Go to Admin tab | —–> Property column | —–> Tracking Info | —–> Referral Exclusion List. | —–>Add Referral Exclusion

(use the following format to add the domains):

*.social-buttons.com

*.semalt.com

etc.

(Return to Admin Tab)

—–> Admin tab | —–> View column | —–> View settings | —–> Bot Filtering

check the box Exclude all hits from known bots and spiders

These settings only work with the analytics.js version of the tracking code. Go to your website and check if you are using the latest code.

It should be the same with:

—–> Admin tab | —–> Property column | —–> Tracking Info | —–> Tracking code

If it is not replace it to each page of your site

METHOD-3

If you’re using the ga.js version and dont want to change your google analytics code you have to follow this method

Step1.

—–> Admin tab | —–> View column | —–> View settings | —–> Bot Filtering

check the box Exclude all hits from known bots and spiders

And configure these settings in your code.

Step2.

Add the following script in website Header, before closing head tag:

<script type=’text/javascript’>
var blocklink = ['http://darodar.com', 'http://social-buttons.com'];
for (var b = blocklink.length; b–;) {
if (document.referrer.match(blocklink[b]))
window.location = “http://google.com/”;
} 
</script>

Or for PHP website add the following code in header.php file of theme folder:

<?php
echo”<script language=’javascript’>
var blocklink = ['http://darodar.com', 'http://social-buttons.com'];
for (var b = blocklink.length; b–;) {
if (document.referrer.match(blocklink[b]))
window.location = “http://google.com/”;
} 
</script>
“;
?>
4
  • Thanks..I already had a filter for semalt...is there a way to exclude multiple domain names in GA via a single filter? e.g. comma separated or...? Thanks!
    – Adam
    Mar 24, 2015 at 19:36
  • go to Analytics | —–> Admin tab | —–> Account | —–> Property | —–> Tracking code | —–> Referral Exclusion List. Then just added each domains with like this *.semalt.com *.iliovevitaly.com etc.
    – Christos P
    Mar 24, 2015 at 21:23
  • 1
    As that part of Google Analytics mentions, that works only if you use ga.js, the (I think) older version instead of the newer analytics.js, where it would have to be resolved in the code. Found something else now though: analyticsedge.com/2014/12/…
    – Adam
    Mar 24, 2015 at 23:35
  • At the top of Google Analytics page (REFERAL EXLUSION LIST) is saying: These settings only work with the analytics.js version of the tracking code. If you’re using the ga.js version, configure these settings in your code. If you’re transitioning to analytics.js from ga.js, customize these settings to match your previous configuration for data continuity.
    – Christos P
    Mar 25, 2015 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.