If your Universal Analytics property uses gtag.js, the Upgrade to GA4 wizard can reuse your existing tagging (i.e. the tag being used by your Universal Analytics property). This tag reuse saves you from having to add the tag manually to your web pages and is made possible via a feature called connected site tags.
However, if your Universal Analytics property uses analytics.js, the Upgrade to GA4 wizard won't be able to reuse your existing tag. You'll need to paste the global site tag (i.e. gtag.js) directly into your website pages.
How it works
Here are a few points about how connected site tags work.
- An additional
gtag(‘config’, ‘G-XXXXX’)call is made (without any parameters), which downloads a Google Analytics 4 tag container and sends an automatic page_view event to the Google Analytics 4 property.
- Enhanced measurement events (when enabled) are automatically collected in the Google Analytics 4 property, but are not collected in the Universal Analytics property.
- Any events sent via
gtag(‘event’)to the Universal Analytics property are also sent to the Google Analytics 4 property (except for events with a
“send_to”parameter that only specifies the Universal Analytics property).
- Connected site tags require the full site to be consistently tagged using a gtag.js snippet that is controlled by a single Universal Analytics property. If your Universal Analytics property receives data from mixed implementations (e.g. some pages are tagged with analytics.js or Google Tag Manager), only the eligible pages will send data to the Google Analytics 4 property.
The connected Google Analytics 4 tag ignores any config parameters that customize data collection for the Universal Analytics property -- the connected Google Analytics 4 tag is fired without any config parameters. (Although Google Analytics 4 properties support many of the configuration parameters available for Universal Analytics properties, these parameters have to be included in the config command in order to apply to the Google Analytics 4 property.) You can mitigate this issue by moving the parameters assigned in the
gtag(‘config’) command for Universal Analytics to a
gtag(‘set’) command before the
Here are a few examples of how this can impact specific tagging controls for Google Analytics 4. Tag customizations (such as customized cookie settings, cross-domain linking, disabling advertising features, opting out from Analytics support for Google Ads conversions, and disabling GA measurement) that you may have set up for your Universal Analytics property in the
gtag(‘config’) command are not applied to your Google Analytics 4 property. As a result, you may unintentionally collect the following in your Google Analytics 4 property:
- Remarketing data, even though you have disabled advertising features for the Universal Analytics property on the page
- Analytics data, even when data collection has been programmatically disabled for the Universal Analytics property.
Other caveats to note:
- User_id: The connected Google Analytics 4 tag will ignore any user_id that has been set in the Universal Analytics tag via gtag('config').
- Pageview attributes: Custom pageview attributes such as page_title, page_location, and page_path will be disregarded in the connected site tag. This may result in data discrepancies between your Universal Analytics reports and Google Analytics 4 reports.
Scope of custom dimensions and metrics
Because there are differences between the Universal Analytics and Google Analytics 4 data models, your Google Analytics 4 data will look different from your Universal Analytics data. This is true regardless of whether or not you use connected site tags to implement your Google Analytics 4 property.
For example, in Google Analytics 4 properties, custom event parameters and user properties replace Universal Analytics custom dimensions and metrics. When you use connected site tags, your Universal Analytics custom dimensions and metrics are automatically sent to your Google Analytics 4 property as custom event parameters. However, the scope of the custom dimensions/metrics, e.g. Hit-level scope, Session-level scope, User-level scope, and Product-level scope are ignored by the connected Google Analytics 4 tag, because the scope is set in the Universal Analytics user interface and requires the custom_map config parameter, neither of which is accessible to the connected Google Analytics 4 tag. As a result, custom metrics/dimensions do not persist to any scope beyond the event in an Google Analytics 4 property. This may not meet your needs for event collection and reporting, e.g. if you implement CRM integration by sending a user identifier (e.g., GA client ID or CRM ID) to Analytics as a user-scoped custom dimension.