Giter Site home page Giter Site logo

analyticbotaway's Introduction

AnalyticBotAway

a simple PHP class to catch those nasty crawler bots that spam your analytic reports

What are crawler bots?

A referrer is a name that is passed along when a browser goes from one page to another page (through an HTTP header), and usually it is used to indicate where the user is coming from. Now, this referrer can be changed for anything, and some people will set it to be a page they want to promote. Then they will make repeated requests (probably with an automated script) with the intention of showing in the reports and logs of this WebSite, this is called Referrer Spam.

Why are they doing that?

The most obvious reason is traffic; people are curious by nature, and they want to know what is going on their websites, so they go to the referral URL to check it. These spammers hit thousands of Google Analytics accounts so you can imagine the amount of traffic they are getting with this method. Sometimes to promote a page and sometimes they will redirect you to an online store where they will get a cut if someone buys anything.

How does AnalyticBotAway help?

AnalyticBotAway checks the referrer on every page hit and compares it with a list of public known bots. If the script found a bot It'll send them a "404 - page not found" notice and the bot might not try to visit you again. The script afterwards blocks any content from your page to not get included to your analytics report.

Installation

  • Download the latest version and copy includes/class.analyticbotaway.php
  • Include class.analyticbotaway.php in your PHP file

include('includes/class.analyticbotaway.php');

  • Insert AnalyticBotAway(); before your page

$abw = new AnalyticBotAway;

  • Done!

Ghost Bots

Some Bot's are not visiting your page. Those so called "Ghost Bots" directly interact with Google Analytics and never ever visit your page! To catch those tricky bots you'll have to ban them in Google Analytics. A great tutorial to do that can be found here.

analyticbotaway's People

Stargazers

Bryan "BJ" Hoffpauir avatar

Watchers

Laura Sofia Heimann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.