Allows the user to opt-out of Google Analytics tracking. DSGVO / GDPR.
The Basic Data Protection Regulation (DSGVO, EU-DSGVO, GDPR) stipulates that a site visitor must have the option to object to the collection by Google Analytics.
Until now, this was only possible via browser addon, or complicated JavaScript code embedding on the own website. With this plugin, this is child’s play and the user also has the option to undo the objection.
Features
Regularly check whether the settings are still data protection compliant!
Ever edited the privacy policy page and accidentally deleted the opt-out shortcode? Recently deleted the plugin for Google Analytics tracking, then reinstalled it and forgot to re-enable IP anonymization?
To ensure the highest security, the plugin regularly checks the settings. Should a setting no longer fit, then an error message appears in the WP Admin (Backend / Dashboad) or you will receive an email.
You can freely choose the frequency of the check. The following intervals are available: daily, weekly or monthly.
The following settings are checked:
Integrated compatibility with the following plugins
It is not a requirement to use the listed plugins! The Google Analytics Opt-Out Plugin is also compatible with other plugins and can be used even if the Google Analytics code itself was inserted.
With integrated compatibility, we make work easier because the current UA-Code is automatically read out and kept up to date. This means that it does not have to be corrected manually.
AUTOMATICALLY current privacy policy
Keeping track of all the GDPR legislative changes is not easy. Especially not next to the core business. That’s why we offer you a data protection generator with our partner easyRechtssicher.
The privacy policy is created ONCE and automatically kept up to date in WordPress itself. No more filling out forms again and copying and pasting privacy statements onto the page, it’s completely automated.
More info here: https://schweizer.solutions/datenschutzgenerator
Do you like our plugin?
It motivates us a lot to keep working on our free plugins if you leave us a positive review.
Coded with love bySchweizer Solutions GmbH
This plugin is not from Google and is not supported by Google in any way. Google Analytics is a trademark of Google LLC.
Installation via WordPress
Plugins > Install
Opt-Out for Google Analytics
Manual installation
opt-out-for-google-analytics
into the /wp-content/plugins/
directory of your WordPress installationConfiguration
Note on UA-Code & GA4-Code:
If you have entered the Google Analytics tracking code manually, e.g. with a WordPress theme, then you must enter the tracking code in the input field.
If you have activated one of the compatible Google Analytics plugins, then this item is also selectable. This will automatically read the current tracking code from this plugin, and you do not have to enter it in the input field.
The Data Protection Regulation (DSGVO, EU-DSGVO, GDPR) stipulates that a website visitor must have the option to object to the collection of data by Google Analytics.
Until now, this was only possible via browser addon, or complicated JavaScript code integrations on the own website.
With this plugin, this is very easy and the user also has the option to undo the objection.
Yes, because we also comply with Google’s specifications. More information about the guidelines: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-opt-out
This plugin can also be used if the tracking code was inserted manually at the theme or with the help of a plugin.
Yes, it is recommended to offer the opt-out for Google Analytics in the privacy policy.
Keeping track of all the GDPR legislative changes is not easy. Especially not next to your core business. That’s why we offer you a data protection generator with our partner easyRechtssicher.
The privacy policy is created ONCE and automatically kept up to date in WordPress itself. No more filling out forms again and copying and pasting privacy statements onto the site, it runs completely automated.
More info here: https://schweizer.solutions/datenschutzgenerator
If the site visitor clicks on the opt-out link to disable Google Analytics for him, then a cookie is set. With this cookie, the system knows that this site visitor should not be tracked on the website.
This cookie is only valid in the browser with which the site visitor was on the website and clicked on the opt-out link. If the visitor uses a different browser, he would have to click on the link again.
If the site visitor clears his browser data (cookies, download history, etc.), the cookie is also deleted and the site visitor would have to click on the opt-out link again.
You can deactivate the status of the plugin under “Settings > GA Opt-Out”, there you only have to uncheck “Activate opt-out function”.
You can deactivate the whole plugin under “Plugins > Installed Plugins” by clicking on “Deactivate” for the “Opt-Out for Google Analytics” Plugin.
After deactivating the plugin, you can remove it completely by clicking on “Delete”.
You can use the shortcode [gaoo_optout]
in posts, pages and widgets (text widget).
Yes, you can. For this purpose we have included appropriate filters and action hooks.
// Before the shortcode is resolved add_action( 'gaoo_before_shortcode', 'my_before_shortcode', 10, 2); function my_before_shortcode( $tracking_code, $current_status ) { // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX" // $current_status - The current status of the page visitor: activate or deactivate } // After the shortcode is resolved add_action( 'gaoo_after_shortcode', 'my_after_shortcode', 10, 2); function my_after_shortcode( $tracking_code, $current_status ) { // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX" // $current_status - The current status of the page visitor: activate or deactivate } // Before the JS code, to disable GA, is issued add_action( 'gaoo_before_head_script', 'my_before_script', 10, 1); function my_before_script( $tracking_code ) { // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX" } // After the JS code, to disable GA, is issued add_action( 'gaoo_after_head_script', 'my_after_script', 10, 1); function my_after_script( $tracking_code ) { // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX" } // The UA-Code used add_filter( 'gaoo_get_ua_code', 'my_ga_tracking_code', 10, 2 ); function my_ga_tracking_code( $tracking_code, $ga_plugin ) { // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX" // $ga_plugin - Selected source for the tracking code } // Whether the page should be reloaded after the click add_filter( 'gaoo_force_reload', 'my_force_reload', 10, 1); function my_force_reload( $force ) { // $force - "true" = force reload; "false" = do not reload }
It happens that some self-developed themes do not resolve shortcodes and the plugin does not work.
To execute the shortcode anyway, you have to use this code in the theme, at the desired position:
echo do_shortcode('[ga_optout]');
If the settings have been changed, e.g. in a compatible Google Analytics tracking plugin, then this change will only be noticed during the autom. check (weekly).
It is possible to perform the check beforehand. To do this, the “Save changes” button would have to be clicked under “Settings > GA Opt-Out”.
This will read the new settings and save them for a week until the next automatic check.
The JavaScript event gaoptout
is fired on the window
object, which can be reacted to.
If the page visitor clicks on the link to perform an opt-out, then a false
is passed as the value. If the visitor performs an opt-in, then a true
is passed.
Example code:
jQuery(window).on(‘gaoptout’, function (e) { console.log(e.detail); });
You have the possibility to change the appearance of the link via CSS in the settings of the plugin. For this purpose, the following CSS classes are available:
The link itself:
#gaoo-link { … }
The link if the page visitor has disagreed with the tracking:
.gaoo-link-activate { … }
The link if the page visitor has NOT disagreed with the tracking:
.gaoo-link-deactivate { … }
You can enter several recipient addresses, separated by a comma, into the input field for the e-mail, which should receive the status message.
Example: [email protected],[email protected],[email protected]
The status check runs in the set interval and only sends e-mails if at least one status is set to red.
If you still do not receive any e-mails, it can have the following causes:
Our recommendation is therefore:
The opt-out cookie is set according to Google’s specifications. Thus, the GTM (Google Tag Manager) should not need to be adjusted.
However, if the Google Analytics code is not loaded at all, the GTM must check whether the cookie is set or whether the value in the “HTML5 Local Storage” is set accordingly.
On this basis, it can be decided in the GTM whether the code should be loaded or not.
If no entry or cookie is present, then no opt-out has taken place. This is also the case if the value “false” is returned.
The opt-out has only taken place if the value “true” is returned.
Specific cookie, with the corresponding tracking code: ga-disable-UA-XXXXX-YY or ga-disable-G-XXXXXXXXX
Generic Cookie: ga-opt-out
Specific entry in the HTML5 Local Storage: ga-disable-UA-XXXXX-YY or ga-disable-G-XXXXXXXXX
Generic entry in the HTML5 Local Storage: ga-opt-out
The use of this plugin is at your own risk. The website operator must be able to ensure the functionality of the plugin itself.
To do this, it must be checked, among other things, whether after clicking on the link, a cookie in this format was set: ga-disable-UA-XXXXXXXX-YY
Supporting, for the Google Tag Manager, another cookie with the name “ga-opt-out” is set.