Google Opt Out

Google Opt Out

Google provides a great analytics tool. But you should consider the privacy of your visitors. This extension allows your users to opt out from Google's tracking.

How to use

Installation

Using this extension is very easy. Just install it from Pagekit's marketplace.

Configuration

After enabling the extension, you can enter your property ID (e.g. UA-123456-1); if spqr/googleoptout should take care of your scripts, just check the box labeled Manage Tracking Code. If you do so, please remove the Google Tracking script from your site, if you inserted the code before.

If you don't enable this, please make sure to remove the line gtag('config', 'UA-123456-1'); from your script.

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-123456-1">
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

   gtag('config', 'UA-123456-1');
  </script>

Expected result:

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-123456-1">
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
  </script>

You then need to call gtag('config', 'UA-123456-1'); later (make sure the extension has been executed).

Warning: If you are including the script by yourself, you need to make sure, that the Google-scripts are loaded after the Opt Out has been running. It's highly recommended to use the built-in tag management.

CMS
Pagekit
Googleoptout-1

Googleoptout-1

Googleoptout-2

Googleoptout-2

Googleoptout-3

Googleoptout-3

Googleoptout-4

Googleoptout-4

Googleoptout-5

Googleoptout-5

Wait a second!

Did you know that there's are great support channels for Pagekit? Visit us today and sign up for free using email or your GitHub-, Twitter-, Google- or Facebook-Account.

Latest blog posts

Latest comments

  • How to fork a theme

  • spqr/toc updated

  • spqr/toc updated

Like my work?

If you would like to support my work, you are invited to do so.