Directory / plugin
Opt-Out for Google Analytics (DSGVO / GDPR)
v2.7.1 · by Schweizer Solutions GmbH
GDPR opt-out link for Google Analytics 4 as block, Elementor and Divi module, with automatic status check, uptime monitoring API and webhooks.
About this plugin
The General Data Protection Regulation (GDPR, German: DSGVO) requires that website visitors can object to the collection of their data by Google Analytics.
Until now, this was only possible with a browser add-on or with complicated JavaScript code on your own website. With this plugin, it is child’s play, and visitors can also undo their objection at any time.
And the plugin makes sure that it stays that way: it checks regularly whether the opt-out still works on your website, and notifies you by email, in Slack, Microsoft Teams or Discord, or in your uptime monitoring, if something is wrong.
Features
Opt-out for your visitors
- Support for Google Analytics 4 (GA4)
- Visitors can disable Google Analytics tracking for themselves and enable it again later.
- The texts of the opt-out and opt-in link can be customized, also individually per block, widget, module or shortcode.
- After the click, the popup text is shown as a browser popup or as a notice below the link, optionally with a reload of the page. Also individually per block, widget, module or shortcode.
- Local storage fallback: If a visitor deletes their cookies, the opt-out cookie is restored, as long as the browser’s local storage has not been cleared as well.
- Works with page caching: the link always shows the current status of the visitor.
- Accessible: the link can be used with the keyboard (Enter and space key), and screen readers announce the notice below the link or the new status.
- Compatible with Google Tag Manager
- Optional Google Consent Mode: the opt-out also denies the consent “analytics_storage”, so it also works if Google Analytics is loaded by the Google Tag Manager.
- No other plugin needed to add the Google Analytics code to your website. The plugin can add it for you.
- The GA4 measurement ID (G-XXXXXXXXXX) can be entered manually or read automatically from a Google Analytics plugin (see compatible plugins).
Block, page builders and shortcode
- Gutenberg block with a preview, a warning if the link is not displayed, link colors (also on hover, e.g. as a button), colors of the notice, typography, spacing and alignment. Shortcode blocks with the opt-out shortcode can be converted into the block.
- Elementor widget with individual texts, behavior, alignment, typography, colors and background (also on hover), padding, border radius and the style of the notice.
- Divi module for Divi 4 and Divi 5 with individual texts, behavior, live preview in the Visual Builder, the Divi design settings and the style of the notice. Existing modules are converted automatically to Divi 5.
- Shortcode
[ga_optout]with attributes for individual texts and the behavior.
Status check and monitoring
- Regular check (daily, weekly or monthly) whether the opt-out still works, and “Check now” at any time.
- The check also loads the website and checks whether the opt-out script is loaded (and not removed or delayed by an optimization plugin), which measurement ID is used and whether the opt-out link is displayed on the privacy policy page, with every page builder and theme. Also for websites protected with a password (HTTP basic authentication), e.g. staging websites.
- Email if a check failed, also to several addresses.
- Webhook for Slack, Microsoft Teams, Discord, Google Chat, n8n, Make or Zapier: the result is sent if a check failed, or optionally after every check.
- Dashboard widget with the status check, and integration into the Site Health of WordPress.
- REST API for uptime monitoring (UptimeRobot, Better Stack, Uptime Kuma etc.): a status URL with a secret token returns the result as JSON with an ID per check and the number of passed and failed checks, and the HTTP status 200 or 503.
- WP-CLI commands for the status check, the export and import of the settings and the status of all sites of a network.
- Multisite: overview of all sites in the network admin with filter, search and sorting, the check can be started for one or all sites, one status URL and one webhook for all sites, and the settings can be transferred to all sites, used for new sites. The settings page and the dashboard widget can be hidden for site admins.
Settings and developers
- Modern settings page with a help tab, which contains all instructions, and a preview of the link with the current settings, also before saving.
- Import and export of the settings as JSON file.
- Custom CSS to change the appearance, with line numbers, a check while typing (e.g. for a missing “;” or “}”) and automatic formatting. On the website it is minified and only loaded together with the link.
- Actions and filters for developers, e.g. for own checks, other page builders or the status email (see FAQ).
- Full integration with the privacy features of WordPress
- Compatible with WordPress Multisite
- Compatible with Advanced Custom Fields, Secure Custom Fields, WPML, Polylang and Loco Translate
- Also works on smartphones, provided the browser supports cookies
- Available in English and German
- Supports PHP 7.4 to PHP 8.4
Regular check whether the opt-out still works
Have you ever edited your privacy policy page and accidentally deleted the opt-out shortcode? Or removed your Google Analytics plugin, reinstalled it later and forgot to set up the tracking code again? Or does an optimization plugin delay the opt-out script, so it runs too late?
To keep you on the safe side, the plugin checks the settings and the website regularly. If something is no longer correct, an error message appears in the WordPress admin and in the Site Health, and you receive an email.
You can choose how often the check runs: daily, weekly or monthly. With “Check now” in the dashboard widget or on the settings page, it runs at any time.
The following is checked:
- Opt-out function is enabled
- A valid GA4 measurement ID was found
- Opt-out shortcode, block, Elementor widget or Divi module is present on the privacy policy page
- The privacy policy page is publicly available (published and not password protected)
- The cron job for the status check is active
- The opt-out script is loaded on the website, and not removed or delayed by an optimization plugin
- The opt-out link is displayed on the privacy policy page
- Google Analytics on the website uses the measurement ID of the settings (if it is not loaded after the consent or by the Google Tag Manager)
For agencies and multisite networks
wp gaoo statusshows the result of the status check with WP-CLI,wp gaoo status --runruns it first. The command fails if a check failed, so it can be used in a monitoring script.- The status URL (REST API with a secret token) returns the result as JSON, with the HTTP status 200 or 503. An uptime monitoring like UptimeRobot can check it without access to the server, and your own scripts can evaluate each check by its ID. The texts are English, or translated with the parameter
lang. - In a multisite network, the network admin shows the status of all sites with filter, search and sorting, and the check can be started for one or all sites. One status URL of the network shows the status of all sites, for one monitor of the whole network.
wp gaoo network statusandwp gaoo network checkshow and start the check of all sites,wp gaoo settings exportandwp gaoo settings importtransfer the settings, e.g. in a deployment script.- A webhook sends the result to Slack, Microsoft Teams, Discord, Google Chat or a service like n8n, so your team sees problems without checking emails.
- In a multisite network, the settings page and the dashboard widget can be hidden for site admins, so only super admins change the settings, while site admins still see the status.
- The settings can be exported and imported, and in a network transferred to all sites. New sites can get the settings of a site automatically. The settings of each site (source and code of Google Analytics, privacy policy page, access data, email addresses and webhook) are not transferred.
- With filters, you can add own checks (e.g. for a cookie banner), send the result to another service or change the recipients of the status email.
Built-in compatibility with the following plugins
You do not need any of these plugins! The plugin also works with other plugins, or if you have added the Google Analytics code yourself.
With the built-in compatibility, the current GA4 measurement ID is read automatically and kept up to date, so you never have to correct it manually.
- MonsterInsights Pro
- MonsterInsights – Google Analytics Dashboard for WordPress (Website Stats Made Easy)
- ExactMetrics – Google Analytics Dashboard for WordPress (Website Stats Plugin)
- Analytify – Google Analytics Dashboard Plugin For WordPress
- GA Google Analytics
- Site Kit by Google – Analytics, Search Console, AdSense, Speed
Privacy policy that is AUTOMATICALLY kept up to date
Keeping track of all changes in data protection law is not easy, especially alongside your core business. That’s why we offer a privacy policy generator together with our partner eRecht24.
You create your privacy policy ONCE, and it is automatically kept up to date in WordPress. No more filling out forms and copying and pasting privacy statements: it is completely automated.
More information: https://schweizer.solutions/erecht24
Do you like our plugin?
A positive review motivates us a lot to keep working on our free plugins.
Coded with love by Schweizer Solutions GmbH
This plugin is not made or supported by Google. Google Analytics is a trademark of Google LLC.