Skip to content

Google Analytics Opt-Out plugin for WordPress

Leer esta información en Español

This is a WordPress plugin to automate the possibility of offering the user to set the Opt-out for data from Google Analytics, to meet the new European standard for cookies.

The plugin automatically searches for properties you have set up Google Analytics on your website, and with a simple shortcode, you can put the option to opt-out on the page with your privacy policy ( or just any other ).


DOWNLOAD PLUGIN

Want to stay abreast of developments in the plugin? , Visit my Twitter ,

You can also subscribe to the blog to see when we publish a new version : Suscribe to Feed .

How to install:

  1. Upload the contents of the Zip file  to your WordPress plugins folder
  2. Activate the plugin and go to plugin settings page
  3. The plugin will try to detect the UA’s code for which you want to opt-out if you had several.
  4. Now in your page where you prefer privacy or gets the following: [privacy-opt-out], and you will leave the option to opt-out to the user and tell if it is already in that like it or not, by the otherwise if you want to be able to track back to do it too.

More info on the origin of this plugin : Tracking Opt-out en Google Analytics a través de su API ( Spanish )

How it works

The plugin sets a cookie on the user side with values that you have enabled at the setup page, and from there the plugin checks every time the user views a page, depending on whether the cookie is set, prints the correct code using the API Google Analytics which disables the sending of data for that UA’s

Features:

  • Automatically searches for property codes on the cover of your site (UA¡s).
  • Add a text and a button where you put the shortcode.
  • The user can set on his own if he wants to be tracked or not.
  • You can select the opt-out only for one single property if you had several.
  • The text and opt-out button are in a layer called “ga-opt-out” (id), so you can style it in your CSS’s.
  • When a user clicks on Opt-Out button, an event is sent to Google Analytics, (Category: Privacy Settings, Action: opt-out)

opt-out-plugin-wordpress_2

Changelog

TO-DO

  • Multilanguage.
  • Ability to set the text of the opt-out from the plug-in manager.
  • Improved properties detection (search on included js’s , etc.).
  • Write help in Spanish and English.
  • AJAX update of opt-out div instead of reloading the page.
  • Possibility to set the UA’s manually, in the case of non Autodetectable.
  • Improve Management plugin.
  • User Opt-in detection
  • Add support for older ga.js implementations ( not async ).

Release version 0.1.1

  • Using Curl, if available, otherwise tries to use fopen.
  • Tracks the count of users opted-out using GA events. (Only asynchronous code)

Release version 0.1.0

  • Automatically searches for property codes on the cover of your site (AU’s)
  • Add a text and a button where you put the shortcode
  • The user can set on his own if he wants to be tracked or not.
  • You can select the opt-out only for one single property if you had several.