This website shows a simple way to ask just those users blocking both ads and analytics to opt in to enabling Google Analytics, and further motivates them to opt in by locking just those users out of your site unless they opt in. Users with no ad blocker, or with an ad blocker that allows Google Analytics are not affected in any way.

In this example, the users has only one button to opt in to using Google Analytics. The other implicit choice is to not click the button, but then the users is locked out of the site until they do.

When you click “Yes”, the website will start recording Google Analytics calls on subsequent page views and the user will have full access to the site.

You can clear your cookie and choose again by clicking the button below.

To create an example just like this on your own website using Adtoniq, follow these steps:

  1. First, ensure that you have installed Adtoniq, registered with Adtoniq Cloud, and entered your Cloud Key in Adtoniq. For more information on installing Adtoniq, see our online documentation.
  2. Ensure that you have properly configured Adtoniq for Google Analytics. Learn more about using Adtoniq for Google Analytics.
  3. Create a new page on your website to send users to when they attempt to access your website with an ad blocker, and have not (yet) chosen to opt in to letting you use Google Analytics.
  4. In the Messaging section, enable the alert, and choose “Users blocking ads and analytics”.
  5. In the Message Options section, make sure “Select message to edit” is set to “Greeting Message”.
  6. Enter text such as “We use analytics on our website to improve our services. Would you like to opt in to using analytics?”
  7. In the Message Options section, set “Select message to edit” to “Confirm Message”.
  8. Enter text such as “Thank you for supporting our site”.
  9. In the Button Options section, enter “Yes” for confirm button text, and leave the reject button text and custom button class fields empty.
  10. Click the Save Changes button.
  11. Click on the Protection tab.
  12. In the “Site Protection Status” section, choose “Entire site is protected”.
  13. In the field labeled “Send adblocked users to this page”, enter the URL to page you created in step #2.
  14. Click the Save Changes button.
  15. To create a button to allow the user to clear their Adtoniq choice cookie and choose again, embed the following shortcode somewhere on your page: [adtoniq_clear_choice style='button']Clear your Adtoniq choice and choose again[/adtoniq_clear_choice]