skip to Main Content

I use Google Analytics to get visitors statistics on my webiste (PHP) and I see that a lot of traffic comes from sites like share-buttons.xyz, traffic2cash.xyz and top1-seo-service.com. I think this is because I use SEO-firendy URL:s (for looks in the addess bar).

This is not really a problem for the site itself, but when I look at the statistics in Google Analytics it includes these robots and non-users and the numbers are therefore not true.

Is there a way to block these robots or do I have to subtract the robots visits from the statistics manually every time I want a report?

2

Answers


  1. If you see this happening you can prospectively exclude them from all future reports in GA by using a filter on that view (admin – filters, create filter, then apply to specific view)

    GA FILTER

    If you specifically want to do it proactively using PHP then you could use some regex to match undesirable referrers in request headers and return nothing.

    Login or Signup to reply.
  2. The answer to the main question is yes, but it requires to be be persistent and it is basically an ongoing task that you will need to perform. Yes, I know is a pain.

    Just to let you know this has nothing todo with PHP or your friendly URL, your website is being a victim of what is known as ghost referrals. Google has not publicly said anything on the topic but just recently I found this article reporting that Google has finally found a solution here.

    However, I choose to be sceptical about this. In the mean time this is what you need to do:

    1. Make sure to leave a view untouched without any filters (Read the fourth paragrah)
    2. In Google Analytics > admin > view > View Settings> Check “Exclude all hits from known bots and spiders” like this.
    3. In the same view block spam bots: a) Check the list of ghost referrals in YOUR REPORT following this method and b) Create a filter like this.

    I recommend you to read this article in full that contains lots of details and more information.

    Some people like to create filters with Regex listening all the spammy bots, if you want to check a up to date list visit this repository.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search