Google Universal Analytics

This section discusses how to migrate the Adobe-built Google Analytics (Universal Analytics) extension to the Acronym-built Google Site Tag (gtag) extension.

Adobe's Google Analytics (Universal Analytics) extension uses Google's analytics.js, which Google will likely deprecate in the next year or two. gtag.js replaces analytics.js and is considered as a single library for all of Google's marketing products, hence the "global site tag" name. It is important to keep in mind that migrating between analytics.js to gtag.js is not exact and some features were deprecated or automated.

Extension Configuration

The following sections cover the settings that exist in the Universal Analytics extension and where they should be mapped within the account configuration in the Gtag extension. It is highly recommend to read and understand how to configure the extension before making a migration. For almost all N/A values they no longer exist for the gtag library.

Library Management

Currently, custom locations / library code is not supported by our extension.

UA Setting

Gtag Category

Gtag Setting

Manage the Library for me

N/A

N/A

Load the library from a custom URL

N/A

N/A

Use the library already installed on the page

N/A

N/A

General

These settings are the most commonly set settings, and largely map to similar names / settings in the gtag extension.

UA Setting

Gtag Category

Gtag Setting

Development Tracker ID

Account Information

Development Account ID

Staging Tracker ID

Account Information

Staging Account ID

Production Tracker ID

Account Information

Production Account ID

Tracker Name

N/A

N/A

Data Sample

N/A

N/A

Site Speed Sample

N/A

N/A

Enable EU compliance for Google Universal Analytics

N/A

N/A (consent management coming soon)

Tracking Cookie Name

N/A

N/A

Anonymize IP addresses

Privacy Settings

IP Anonymization

Force SSL

N/A

N/A

Force lowercase on all pageview, event, and custom variable calls

N/A

N/A

Always send HTTP referrer URL

N/A

N/A

Enable cross-domain tracking

Cross Domain Tracking

Multiple: * Accept Incoming * Domains

Cookies

UA Setting

Gtag Category

Gtag Setting

Visitor Cookie Timeout

Cookies & User IDs

Cookie Expires (# of days)

Cookie Name

Cookies & User IDs

Cookie Name

Cookie Domain

Cookies & User IDs

Cookie Domain

Legacy Cookie Domain

N/A

N/A

Campaign Tracking

Unfortunately, Google has removed the ability to change the URL parameter keys for each of the campaign details. However, you can overwrite the campaign information (see below).

UA Setting

Gtag Category

Gtag Setting

Set # as the query string delimiter

N/A

N/A

Content Key

N/A

N/A

Medium Key

N/A

N/A

Name Key

N/A

N/A

Campaign ID Key

N/A

N/A

Source Key

N/A

N/A

Keyword/Term Key

N/A

N/A

Overwriting Campaign Values

Note: This is an undocumented feature from Google - hence the lack of including it in our extension. Use at your own risk and please test this before publishing to production!

To overwrite the campaign values, you'll need to create a data element that returns a JavaScript object with the following properties: medium, source, name, content, term, and/or id. Both medium and source are required if id is not passed.

return {
  medium: "cpc",
  source: "acronym",
  name: "acronym.com spring sales event",
  content: "",
  term: ""
};

Once the data element has been built, set the campaign data field (in the Custom Data Fields section) to have the value of the newly created data element.

Customize Page Code

The customize page code is roughly equivalent to the Custom Configuration Code within the gtag extension. However, it is important to note that the ga and trackerName parameters will not exist, and the syntax for your custom code will very likely need to change.

Rule Actions

The Adobe-built Google Universal Analytics extension providers three actions that can be used within your rules. This section covers how to migrate these actions to the Acronym-built gtag extension.

Send an Event

This action lets you send an event to Google's servers for your accounts. An event is typically an interaction on the page you want to track that may or may not require a browser refresh, such as a purchase, form submission, video view, or button click. This mirrors the Send an event action within the gtag extension.

Event Category, Action, Label, Value, and Non-interaction events have exact matching fields that you should migrate the values over to. For the event parameters, these can be migrated to the additional data fields. For dimensions and metrics, see Set Dimensions/Metrics for how those are now mapped in gtag. Otherwise, the data field name will provide a dropdown with hints on new key names.

Send a Page View

This action lets you send a page view server call to Google — similar to what a browser load would send if the tag were directly on the page instead of in Launch. This mirrors the Send a page view action within the gtag extension.

If needed, you can set the Document Path, Title, and Location via a custom data field within the Google Analytics settings on the rule action (page_path, page_title, and page_location respectively).

Set Dimensions/Metrics

Setting dimensions in metrics in gtag works differently than it did for Universal Analytics. Instead of directly updating dimensionX or metricY, you must instead map the dimensions to a unified key/value pair (we call them "data fields" in the extension) that is then used in the Set persistent values action. Google has done this to provide unity across all of their products, simplifying the deployment. To map the dimensions to the data field names, you must do this within the gtag extension configuration, under the Custom Dimensions & Metrics section.

As an example, if yourdimension1 is for the visitor's account type, in the extension configuration, you'd map the dimension1 to account_type:

Once the dimension or metric is mapped, you simply use the new data field name in the Set persistent values action and set the value to a static string or pull in a data element:

Last updated