Google Analytics Cookie


How to Connect the Cookies to the Privacy Panel 3 simple Steps:

In this example we will show you how to modify the Google Analytics code:

Step 1:

Find the cookie script in the source code of your website. It should look something like this:

1<!– Global Site Tag (gtag.js) – Google Analytics –>
2<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
3<script>
4window.dataLayer = window.dataLayer || [ ];
5function gtag(){dataLayer.push(arguments);}
6gtag('js', new Date ( ) );
7gtag('config', 'GA_TRACKING_ID');
8</script>
Step 2:

Look at line 2 from Step 1. Add the orange text between “script” and “async”: type=“text/plain” data-trucookiecontrol=“statistics”.

Before

1<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>

After

1<script type="text/plain" data-trucookiecontrol="statistics" async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
Step 3:

Look at line 3 from Step 1. Add the orange text between “script” and “>” (the angle bracket): type=“text/plain” data-trucookiecontrol=“statistics”.

Before

1<script>
2window.dataLayer = window.dataLayer || [ ];

After

1<script type="text/plain" data-trucookiecontrol="statistics">
2window.dataLayer = window.dataLayer || [ ];

Final Result

1<!– Global Site Tag (gtag.js) – Google Analytics –>
2<script type="text/plain" data-trucookiecontrol="statistics" async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
3<script type="text/plain" data-trucookiecontrol="statistics">
4window.dataLayer = window.dataLayer || [ ];
5function gtag () {dataLayer.push(arguments);}
6gtag('js', new Date());
7gtag('config', 'GA_TRACKING_ID');
8</script>

To finish the process Save Your Changes.