Google Analytics (ga.js): GDPR, cookies and installation

Analytics
Consent-controlled integration
Google Analytics (ga.js)
7 cookies listed Privacy policy
service gajs
4.3M
requests / 30 days

21.85% consent


Google Analytics (ga.js) and GDPR: how to manage consent

Google Analytics (ga.js) is an audience measurement or analytics service. Depending on its configuration, its use may involve browser storage, tracking technologies or the transmission of data to a third-party provider.

When the configuration of Google Analytics (ga.js) requires consent, the service should only be activated after the visitor has made a choice. tarteaucitron can condition its loading on that decision.

Managing Google Analytics (ga.js) with tarteaucitron

When Google Analytics (ga.js) is integrated through tarteaucitron, its activation is managed according to the visitor's consent choice. The service can therefore be loaded only when the corresponding permission has been granted and the visitor can later change this choice through the consent interface.

Cookies and storage used by Google Analytics (ga.js)

The current tarteaucitron integration declares 7 cookies associated with Google Analytics (ga.js):

  • _ga
  • _gat
  • __utma
  • __utmb
  • __utmc
  • __utmt
  • __utmz

This list corresponds to the cookies currently declared in the tarteaucitron service definition. The service provider may change its technical implementation over time.

Configuring Google Analytics (ga.js)

Add the following code to your website after initializing tarteaucitron. Replace the example values with those provided by Google Analytics (ga.js).

<script>
tarteaucitron.user.gajsUa = 'UA-XXXXXXXX-X';
tarteaucitron.user.gajsMore = function () { /* add here your optionnal _ga.push() */ };
(tarteaucitron.job = tarteaucitron.job || []).push('gajs');
</script>

Code to remove

Default HTML code to remove from your website:

<script> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); // your optionnal _ga.push() </script>

For a complete guide, read the documentation to install tarteaucitron.js.

Privacy information

For detailed information about the processing of data by Google Analytics (ga.js), cookies and applicable retention periods, refer to the documentation or privacy policy published by the service provider:

Google Analytics (ga.js) privacy information

Frequently asked questions about Google Analytics (ga.js)

Does Google Analytics (ga.js) require consent?

It depends on how Google Analytics (ga.js) is configured and which data is processed. Audience measurement tools using non-exempt tracking technologies generally need to be conditioned on the visitor’s consent.

How does tarteaucitron block Google Analytics (ga.js)?

tarteaucitron controls the activation of Google Analytics (ga.js) according to the consent choice recorded for the visitor. The service code is triggered through tarteaucitron instead of being loaded independently from the consent manager.