GA4 tag doesn't collect data when there's a UA connected site tag

Created on 3 April 2024, 5 months ago
Updated 9 April 2024, 5 months ago

Problem/Motivation

For a website migrated to Google Analytics 4 that’s recieving data from the corresponding Universal Analytics [connected site tag](https://support.google.com/analytics/answer/9973999?hl=en&utm_id=ad)

When we configured the Google Tag module with the GA4 tag instead of the connected site tag, it did not collect data.

The tag was placed as follows in the site’s html:

The workaround we found was to configure the Google Tag module with the connected UA-XXXXXXXX site tag, which allowed data to be collected instantly.

The html changed as follows:

This didn’t happen with the deprecated Google Analytics module when a G-XXXXXXXX tag is used the UA-XXXXXXXX connected site tag is not placed.

Steps to reproduce

1. Drupal 10.2.4 site
2. Google tag module 2.0.4 installed and enabled.
3. Configure the module with the GA4 G-XXXXXXXX tag of a property that has a UA connected site tag
4. The rest of the settings are default.
5. After a while check the Realtime in Google Analytics report, no data should be collected.

Proposed resolution

It’s probably enough warn users that are migrating from the other Google Analytics modules that if their GA4 property is collecting data vía the UA connected site tag then they should configure the module with the UA-XXXXXXX tag or recommend them to disconnect the UA tag from the GA4 property data stream if they prefer using the new G-XXXXXXXX tag

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Miscellaneous

Created by

🇨🇱Chile amanda cook Santiago

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024