Configure the gtag extension with your Google products, as well as advanced gtag.js settings.
This extension allows you to setup multiple accounts for multiple product types, from one interface. You can have an unlimited number (though we'd feel bad for your visitors having to load 1000's of conversion pixels...) of Google Analytics, Google Marketing Cloud (DoubleClick Floodlight), and Google Ads (AdWords) accounts setup within this extension.
To get started, click the "Add Account" button and fill in the fields. Descriptions of the fields and their importance can be found below.
New installations will see this message. Click the "Add Account" button to get started.
Each account is configured independently and a description of the fields shown in the extension configuration can be found below.
Below are all of the settings that are available for accounts.
The name is only used to reference this account in the various settings in Launch. It can be anything, but it is recommended to be descriptive.
This should be the account ID provided from the Google product's interface. It can also be a data element that returns this account ID. If a data element is not used, the account ID should start with
G-. Once a product is added, you can add additional account IDs for each Launch environment. It is recommended to send data in the development or staging environments to a different account ID to keep the data within the Google product clean of test/QA data.
The product type that this account belongs to. If you've entered an account ID string, as mentioned above, this will be pre-populated for you and cannot be changed.
Google Marketing Cloud
The name of the cookie that is set by Google Analytics. Defaults
The domain that the Google Analytics cookie should be set to. Defaults
auto. You should only use this to limit the cookie to a subdomain.
The number of days the cookie should remain uneaten in the user's browser. The default value for
A user ID that is unique, persistent, and non-personally identifiable can be sent to Google Analytics to help identify users across devices via
user_id. Be sure to have a user ID view enabled on the property.
Google Analytics can track users across domains by passing a
_gaURL parameter in links on the page to other domains with the visitor's Google Analytics ID and an expiration timestamp. Learn more about cross domain tracking.
If this setting is enabled, any visits to the page that contain the
_gaparameter will have it parsed and the visitor's ID will be set for the current domain. If you only have a single domain, you can disable this without any loss of traffic. If you have multiple domains you want to track visitors across, this should be enabled. If any domains are entered in the "Domains" field, this will automatically be enabled and cannot be disabled. If a data element is used, it should return a boolean
By default, forms that are submitted to other domains will not have the
_gaparameter added to the URL. If this setting is enabled, those forms will decorate the URL with the
_gaparameter upon form submission. If a data element is used, it should return a boolean
In Universal Analytics, you can set custom dimensions and metrics that can enrich the out-of-the box data to help with your business' reporting needs. When implementing Universal Analytics via gtag, you must first map your custom dimensions to custom fields since multiple Google products share the same custom fields. This means that if you are setting an "Account Type" into the custom field
account_type, it can then be used within Google Marketing Cloud and Google Ads. You can learn more about setting custom dimensions for Universal Analytics via gtag in Google's documentation.
The mapping consists of two parts:
- 1.Custom Dimension / Metric Name - this should be the dimension or metric name from the Google Analytics interface, such as
- 2.Data Field Name - this should match the name you use in the Custom Data Fields section. If you do not have a field already in mind / mapped, you should create a name the is unique and descriptive. The name should be alphanumeric and may include underscores.
Using account type as an example, if you have a custom dimension setup in Google Analytics with an index of
Account Type setup in Google Analytics as Custom Dimension 1
Then your mapping should look similar to this:
dimension1 is now mapped to the account_type custom data field
Then, in the custom data fields section (in the extension configuration or any of the actions), you can pass in static values or data elements as values to your dimension/metric.
Custom Data Field that maps the account_type data element to account_type (dimension1)
After a custom dimension or metric is mapped, the data field name will show up in the autocomplete boxes within custom data fields input.
The "account_type" field is populated in the autocomplete dropdown.
Add in your Google Optimize account ID here. The account ID must be valid and active, otherwise subsequent page view and event calls can fail to load properly. When this happens a network request to
https://www.google-analytics.com/gtm/js?id=GTM-XXXXreturns a 404 and blocks further requests. Unfortunately, this is a limitation of the core gtag library.
Below are the available settings for Google Ads.
When enabled, this allows you to track incoming visitors via the
_gcl_awfirst party cookie. This allows visitors to be tracked to the conversion event. It is recommended to enable this, but if you need to prevent first party cookies from being set by Google Ads, you should disable this feature.
By default, all accounts will use the same cookie name. If you've added multiple Google Ads accounts, it is generally recommended to set a prefix to the cookie to keep the conversions separated. Learn more in Google's documentation.
There are currently no Google Marketing Cloud specific settings. Any settings that Google adds in the future can be set via the Custom Data Fields below until Acronym has updated the extension to include the latest settings.
Custom data fields in the gtag extension allow you to map any additional settings that weren't listed above, as well as setting custom dimension and metric values. For Google Analytics, seeing above for mapping custom dimension and metrics.
Passing custom data fields within the extension configuration will set that value on every page view, but will not set it for any events. This should be used for additional configuration settings that are not shown in the extension UI.
Setting custom data fields in the set persistent values action will persist the value on every page view or event made after this action. This is useful for setting information about the user that should be included on every hit and doesn't change. The account type example mentioned in the Google Analytics settings above would be a great use case for the set persistent values action.
When setting custom data fields in the send a page view action, the values will only be sent with that page view. A use case of this would be to overwrite the
page_pathvalues if you want to change the page's title that you would see in the reports.
Finally, you can set custom data fields within the send an event action. Like the send a page view action, custom data fields set within the send an event action will only be passed on that single event. This is useful for passing more information about the event (e.g. login method).
It is important to note how Google persists data when using these fields. Custom data fields set in events will have priority, followed by the page views, followed by the set persistent values action.
Let's say you had the following actions called for your accounts:
Pretty straight forward, right? Now let's look at another, more complex example:
Finally, let's look at one last example, where the extension configuration has a custom data field:
You can see how this can get confusing when you're trying to persist custom data fields. The set persistent values action is useful for setting values that won't change and apply to all accounts. Otherwise, you're better off setting the value in the config.You can read more about this in Google's documentation.
Removing / Disabling Accounts
Since this extension allows you to add multiple accounts, at some point you may need to remove or disable an account.
Right now, it is not possible to disable an account from the extension configuration. This is because Adobe bundles all settings saved into the library on the page. We've opted to keep the Launch library as light as possible for your end users and not include any settings for accounts that would be disabled. We're looking into potential workarounds, but please vote on our idea to allow for this natively in Launch.
To remove an account from the extension, navigate to the account and then click the "Remove Account" button at the bottom of the account's settings. A confirmation will appear to make sure you want to remove the account.
The warning popup when you attempt to remove an account.
It is then recommend go into any rule actions that used the account, and save the changes to remove any additional bloat (the account settings if it was enabled for that rule) within the Launch library. Unfortunately, the Launch API for extensions does not allow for developers to automatically update other action settings, so this must be a manual process. We have an idea in the Adobe forums to allow extension developers to automate this, so please vote to see this implemented!
If you've removed an account, you can still re-add the account by comparing versions (the
...button at the top right of the extension configuration screen), selecting the previous revision, and clicking the "Use these changes" button.
Revision comparison showing an account that was removed in the latest version
If you've saved any rules that used the deleted account since it was deleted, you'll need to rollback the rule to the previous version as well.
These settings are completely optional and geared towards more advanced users. If you're unsure of a setting, you should leave it blank to keep the default.
dataLayer, but Acronym recommends that this should be changed to something else as
❤is currently not an acceptable name!)
gtag. It is not recommended to change this unless you have an existing variable named
dataLayervariable, and accounts are all initialized. No page view, event, or set commands have happened at this point, but all of the accounts are available. Your custom code will have access to the
gtagfunction and the
dataLayerarray. Any returned value will be ignored.
An example of the custom code setting, you could inspect the
By default, Google has enabled display features, or data collection for personalized ads. This setting lets you turn display features off for everyone, or conditionally by providing a data element. Your data element should return a boolean