Search code examples
google-analyticsgoogle-analytics-api

Is it possible to track basic analytics data without asking consent?


hope someone can help with this problem we are having.

We are using google analytics on several websites with the only purpose to have a visits counter of each one.

We do it using Google Analytics Reporting API and this is the only reason: we don't use it for marketing purposes or to analyze audiences or behaviour. We want to understand if this is compliant with GDPR since we don't ask cookie permissions to users on each website or if is there a way to just use Analytics as counter without showing any consent message to users.

Let me know Thanks


Solution

  • There is no universal rule for all UE member states, however many guarantors (such as the Italian one) have stated that by reducing the identifying power of an analytical cookie, this cookie can be considered a technical cookie.

    A technical cookie does not require acceptance but can always be provided

    In order to reduce the identifying power of the Analytics cookie, it is possible to use the IP Anonymization (or IP masking) setting in Google Analytics hit which removes the last octet from the IP that sends (automatically) with the call to the Google servers. In this way, the user cannot be geolocated and the GA cookie is considered to be of a technical nature.

    With Universal Analytics you need to add a setting to the tracking code while with Google Analytics 4 IP anonymization is the default.

    If you use gtag, the code is something like this:

    <!-- IP anonymization with gtag.js - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag() {
            dataLayer.push(arguments);
        }
        gtag('js', new Date());
        gtag('config', 'GA_TRACKING_ID', { 'anonymize_ip': true });
    </script>