The Google tag lets you measure the effectiveness of your website and ads. After you place the Google tag on your website, it sends to linked Google product destinations, such as Google Ads and Google Analytics. You can use a single Google tag implementation for all your products and accounts.
Before you configure the Google tag settings, make sure you set up your Google tag on every page on your website.
This article explains how you can configure your Google tag settings. You can also Manage your Google tag by editing your Google tag name, combining Google tags, or adding or removing destinations.
Open the Google tag settings
Google Ads instructions
Google Analytics instructions
- Open Google Analytics.
- Go to the
Admin screen.
- In
Data Streams, click on a stream to see details.
Result: Your screen should show you the Google Analytics settings and the Google tag settings.
Google Tag Manager instructions
Note: To see Google tag IDs in Google Tag Manager, you need to manage a Google Ads, Analytics or Google tag in a container.
- Open Google Tag Manager.
- Click on the tab Google tags to see Google tags you have previously set up.
- Click on the tag name to edit the Google tag settings.
Configure your Google tag settings
When you are in your Google tag settings, click Show all to review all available settings.
You may choose to configure settings that are less relevant for your current usage of the Google tag. When you add new product destinations or their capabilities change, the settings will go into effect.
Configuration settings | Description | Relevant to Google Analytics | Relevant to Google Ads |
Manage automatic event detection | Configure which types of events your Google tag should automatically detect for measurement in associated destinations. | Yes | Yes |
Configure your domains | Specify a list of domains for cross-domain measurement. | Yes | Yes |
Allow user-provided data capabilities | Configure whether your Google tag should allow user-provided data to be included in measurement for destination products that accept such data. | Not Currently | Yes |
Collect Universal Analytics events | Collect an event each time a ga() custom event, timing, or exception call from Universal Analytics occurs on your website. | Yes | Not Currently |
Define internal traffic | Define IP addresses whose traffic should be marked as internal. | Yes | Not Currently |
List unwanted referrals | Specify domains whose traffic should not be considered to be referrals. | Yes | Not Currently |
Adjust session timeout | Set how long sessions can last. | Yes | Not Currently |
Override cookie settings | Change how long cookies last and how they are updated. | Yes | Not Currently |
Configure your Google tag settings
Manage automatic event detection
Select which types of events your Google tag should automatically detect for measurement in associated destinations. By default, all event types are turned on.
If you turn off automatic event detection, no products or accounts that use this Google tag will be able to receive associated data. You may want to consider turning off collection of these events in your destination instead.
By default, all event types are turned on. Click the switch to turn the following event types off:
- Page views: Detect a page view event each time a page loads. You can't disable this event type.
- Page views on browser history change: Detect a page view event each time the website changes the browser history state. This setting is useful for detecting page views in single-page applications.
- Scrolls: Detect scroll events each time a visitor gets to the bottom of the page.
- Outbound clicks: Detect an outbound click event each time a visitor clicks a link that leads them away from your domain(s). By default, outbound click events will occur for all links leading away from the current domain. Links to domains configured for cross-domain measurement (in the “Configure your domains” setting) will not trigger outbound click events.
- Form interactions: Detect a form interaction or form submission event each time a visitor interacts with a form on your site.
- Video engagement: Detect video play, video progress, and video complete events as visitors view embedded videos on your site. By default, video events will be automatically detected for YouTube videos embedded in your site with JS API support enabled.
- File downloads: Detect a file download event each time a link is clicked with a common document, compressed file, application, video, or audio extension.
Configure your domains
Specify all of your domains that use this tag. This list enables cross-domain measurement and further defines which links on your site do not trigger Outbound Click events when using automatic event detection.
- If you use the same Google tag across domains, they are automatically detected and show up in the Recommendations section. To accept a recommendation, click Add.
To manually add a domain, click Add condition under Include domains that match the following conditions:- Choose a match type.
- Under Domain, enter the identifier for the domain you want to match (e.g., example.com).
- Add each domain you want to include in cross-domain measurement.
- When you’ve specified all the domains that use this tag, click Save.
The changes you make here could affect other Google tags loaded on the same page.
Verify that cross-domain measurement is working properly
Cross-domain measurement works by appending parameters to the URLs on your website. In rare cases, your web server might run into an error, such as returning a 5xx error response code or failing to start a download.
To verify cross-domain measurement works:
- Open a page of your site that contains a link or a form that points to a domain you configured for cross-domain measurement.
- Click the link or submit the form to navigate to the destination domain.
- Verify that the page loads correctly.
- Verify that the URL in the destination domain contains the linker parameter
_gl
. For example:https://www.example.com/?_gl=1*abcde5*
. - If your website provides any downloads: Navigate to a page with the linking parameter in the URL and start a download. Verify that the download starts successfully.
If you encounter an error, try Troubleshooting cross-domain measurement.
Allow user-provided data capabilities
Destination product terms
No data will be collected by destination products if that data is disallowed by that product’s Terms of Service or if the terms required for collecting data from this feature aren’t accepted.
- Google Ads: Google Ads Data Processing Terms
- Google Analytics: Google Analytics Data Processing Terms
Configuration
- To control whether any destination products can receive data from this feature, enable or disable the Allow user-provided data capabilities option. Note: If you choose to turn off “User provided data”, no products or accounts that use that Google tag will be able to receive data from this feature.
- Choose how you want to include user-provided data. User-provided data will be hashed to keep it private and then sent along to your destination products that are configured to receive it with other event data. You can enable one or more configuration options:
- Automatic detection: Automatically inspect the page for strings that match a pattern for email addresses.
- CSS and variable selectors: Specify CSS selectors or JavaScript variables on your page.
- Manual via code: Modify your Google tag to collect data on the account level, see Setting up enhanced conversions with the Google Tag.
- Click Save.
Collect Universal Analytics events
Define internal traffic
traffic_type
parameter appended with the selected value.- Click Create.
- In the top right corner, select the pencil icon
to edit the configuration.
- In the “Rule name” section, give your rule a descriptive name.
- In the “traffic_type” section, choose the name of the
traffic_type
parameter. The default value is ’internal’. - In the “IP address” section, select your match type and enter a value. If you don’t know your IP address, click What’s my IP address?. Matching can be done on either IPv4 or IPv6 addresses. Ranges of IP addresses can be specified using CIDR notation, such as 192.0.2.0/24 or 2001:db8::/32. Learn more about CIDR notation
- Use distinct values to help you differentiate and filter different sets of traffic.
- Click Add conditions. When you’re done, click Create.
List unwanted referrals
ignore_referrer
parameter to events on pages where the traffic source matches the specified domains.- Select to ignore referrals that match any of the following conditions as traffic sources. You can select a match type that:
- Contains
- Begins with
- Ends with
- Exactly matches
- Matches RegEx
- Click Add conditions. When you’re done, click Create.
Adjust session timeout
Products like Google Analytics 4 that receive data from the Google tag use sessions to measure periods of user activity on websites where the tag is installed. Use this feature to change how long sessions should last by adjusting how long it takes before sessions expire due to inactivity or become engaged sessions.
- Adjust session timeout by selecting the hours and minutes. A session is initiated when a webpage is opened. A session ends after a period of inactivity on the part of the user. The default timeout is 30 minutes but can be adjusted here.
- Adjust timer for engaged sessions by selecting the number of seconds. A session becomes an “engaged session“ if it lasts longer than a certain amount of time. The default threshold for engagement time is 10 seconds but can be adjusted here. Learn more about sessions
- Click Save.
Override cookie settings
Change how long cookies last and how they are updated. You can override your Google first-party cookie settings. Learn more about cookies and user identification
Google tags use first-party cookies for various purposes. These cookies have default expiration and update settings, but you can customize these settings by overriding them.
- Click the checkbox to override the default expiration and update settings of cookies used for analytics purposes.
- Set how long before analytics cookies expire. Cookie expiration time will be the current time when the cookie is set or updated plus the value of this field. Learn more about cookie expiration
- Under “Cookie update” choose:
- Set cookie expiration time relative to the most recent visit: By default, each time a user visits your site, your Google tags update the expiration date of associated cookies, extending the cookie lifetime relative to the user's most recent visit.
- Set cookie expiration time relative to first visit: You can optionally set your cookie expiration time relative to your users’ first visit, in which case the expiration is set once and never updated. Learn more about cookie update
- Click Save.
When you've configured your Google tag settings, you can manage your Google tag from the “Admin” tab.