All Projects → Stevie-Ray → Referrer Spam Blocker

Stevie-Ray / Referrer Spam Blocker

Licence: mit
Apache, Nginx, IIS, uWSGI, Caddy & Varnish blacklist + Google Analytics segments to prevent referrer spam traffic 🤖

Projects that are alternatives of or similar to Referrer Spam Blocker

Social-Media-Monitor
Automatically monitor and log fan counters from social media(Facebook Pages, Twitter, Instagram, YouTube, Google+, OneSignal, Alexa) using APIs to Google Spreadsheet. Very useful for website admins and social media managers.
Stars: ✭ 36 (-89.68%)
Mutual labels:  google-analytics
stat-counters
The library, which provides statistics counters, e.g. Google analytics, Yandex metrica, etc
Stars: ✭ 16 (-95.42%)
Mutual labels:  google-analytics
Laravel Gamp
📊 Laravel Google Analytics Measurement Protocol Package
Stars: ✭ 271 (-22.35%)
Mutual labels:  google-analytics
Stop.Google.Analytics.Ghost.Spam.HOWTO
How to stop Google Analytics "Ghost" Spam using a well curated list of spam referrer domains and web sites. Simple and easy to use with instructions for creating Segments in Google Analytics using our google-exclude files.
Stars: ✭ 21 (-93.98%)
Mutual labels:  google-analytics
ob google-bigquery
This service is meant to simplify running Google Cloud operations, especially BigQuery tasks. This means you do not have to worry about installation, configuration or ongoing maintenance related to an SDK environment. This can be helpful to those who would prefer to not to be responsible for those activities.
Stars: ✭ 43 (-87.68%)
Mutual labels:  google-analytics
event-jekyll-theme
Jekyll Theme package for your event
Stars: ✭ 119 (-65.9%)
Mutual labels:  google-analytics
yii2-google-analytics
Google Analytics Universal tracking widget.
Stars: ✭ 14 (-95.99%)
Mutual labels:  google-analytics
Cookies Eu Banner
1kb vanilla JS script which manages cookies consent banner display like asked by GDPR
Stars: ✭ 326 (-6.59%)
Mutual labels:  google-analytics
react-analytics-provider
Super convenient analytics provider for React
Stars: ✭ 47 (-86.53%)
Mutual labels:  google-analytics
Laravel Analytics
Analytics tracking package for Laravel
Stars: ✭ 261 (-25.21%)
Mutual labels:  google-analytics
galytics3
Обертка над стандартной библиотекой google_api_python_client для легкой работы с API Google Analytics v3
Stars: ✭ 16 (-95.42%)
Mutual labels:  google-analytics
aws-web-analytics
Privacy-focused alternative to Google Analytics on AWS Pinpoint
Stars: ✭ 45 (-87.11%)
Mutual labels:  google-analytics
googleAnalyticsProphetR
Applying Facebook's prophet on Google Analytics data
Stars: ✭ 30 (-91.4%)
Mutual labels:  google-analytics
kirby-ga
Kirby GA - Google Analytics
Stars: ✭ 16 (-95.42%)
Mutual labels:  google-analytics
Browserslist Ga
🦔 Target browsers tailored to your audience using Google Analytics
Stars: ✭ 280 (-19.77%)
Mutual labels:  google-analytics
web-analytics-handbook
Handbook - Rendezvous between developers and web data
Stars: ✭ 23 (-93.41%)
Mutual labels:  google-analytics
wp-analytify
Google Analytics Dashboard Plugin For WordPress By Analytify
Stars: ✭ 20 (-94.27%)
Mutual labels:  google-analytics
Next.js Typescript Starter Kit
🌳 [email protected], Styled-jsx, TypeScript, Jest, SEO
Stars: ✭ 342 (-2.01%)
Mutual labels:  google-analytics
Signal
Simple and beautiful open source Analytics 📊
Stars: ✭ 295 (-15.47%)
Mutual labels:  google-analytics
react-seo-friendly-spa-template
React PWA/SPA template initially scaffolded with CRA (Create React App) and configured for SEO. Makes use of prerendering and other techniques/packages in order to achieve a perfect "Lighthouse Score".
Stars: ✭ 24 (-93.12%)
Mutual labels:  google-analytics

Referrer Spam Blocker 🤖

Apache, Nginx, IIS, uWSGI, Caddy & Varnish blacklist + Google Analytics segments to prevent referrer spam traffic


Latest Stable Version Build Status Libraries.io dependency status for latest release Code Quality Packagist License


Apache: .htaccess

.htaccess is a configuration file for use on web servers running Apache. This file is usually found in the root “public_html” folder of your website. The .htaccess file uses two modules to prevent referral spam, mod_rewrite and mod_setenvif. Decide which method is most suitable with your Apache server configuration. This file is Apache 2.4 ready, where mod_authz_host got deprecated.

Nginx: referral-spam.conf

With referral-spam.conf in /etc/nginx, include it globally from within /etc/nginx/nginx.conf:

http {
	include referral-spam.conf;
}

Add the following to each /etc/nginx/site-available/your-site.conf that needs protection:

server {
	if ($bad_referer) {
		return 444;
	}
}

Varnish: .refferal-spam.vcl

Add referral-spam.vcl to Varnish 4 default file: default.vcl by adding the following code right underneath your default backend definitions

include "referral-spam.vcl";
sub vcl_recv { call block_referral_spam; }

IIS (Internet Information Services): web.config

The web.config file is located in the root directory of your Windows Server web application.

Caddy (HTTP/2 Web Server with Automatic HTTPS): referral-spam.caddy

Move this file next to your Caddy config file given through -conf, and include it by doing:

 include ./referral-spam.caddy;

Then start your caddy server. All the referrers will now be redirected to a 444 HTTP answer

uWSGI: referral_spam.res

Include the file referral_spam.res into your vassal .ini configuration file:

ini = referral_spam.res:blacklist_spam

Options for Google Analytics 'ghost' spam

The above methods don't stop the Google Analytics ghost referral spam (because they are hitting Analytics directly and don't touching your website). You should use filters in Analytics to prevent ghost referral spam and hide spam form the past. Because Google Analytics segments are limited to 30.000 characters the exclude list is separated into multiple parts.

Navigate to your Google Analytics Admin panel and add these Segments:

Filter Session Include
Hostname matches regex ```your-website.com
Filter Session Exclude
Source matches regex Copy all the domains from google-exclude-1.txt to this field

Do the same for google-exclude-2.txt. Please note there may be more files in the future.

You can also prevent ghost referral spam by:

Intregrate in a Dockerfile

You can also integrate these configuration file in your Docker repo, so you will get always the most updated version when you build your image. For Apache, Nginx, Varnish 4 or IIS add the following line to your Dockerfile

# Apache: Download .htaccess to /usr/local/apache2/htdocs/
ADD https://raw.githubusercontent.com/Stevie-Ray/referrer-spam-blocker/master/.htaccess /usr/local/apache2/htdocs/

# Nginx: Download referral-spam.conf to /etc/nginx/
ADD https://raw.githubusercontent.com/Stevie-Ray/referrer-spam-blocker/master/referral-spam.conf /etc/nginx/

# Varnish 4: Download referral-spam.vcl to /etc/varnish/
ADD https://raw.githubusercontent.com/Stevie-Ray/referrer-spam-blocker/master/referral-spam.vcl /etc/varnish/

# IIS: Download web.config to /sitepath/ (change sitepath accordingly)
ADD https://raw.githubusercontent.com/Stevie-Ray/referrer-spam-blocker/master/web.config /sitepath/

# Caddy: Download referral-spam.caddy to /sitepath/ (next to your Caddy config file given through -conf)
ADD https://raw.githubusercontent.com/Stevie-Ray/referrer-spam-blocker/master/referral-spam.caddy /sitepath/

# uWSGI: Download referral_spam.res to /sitepath/ (change sitepath accordingly)
ADD https://raw.githubusercontent.com/Stevie-Ray/referrer-spam-blocker/master/referral_spam.res /sitepath/

Like it?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].