Google Ads (Gtag) Destination

Destination Info
Components
Connection Modes
Device-mode Cloud-mode
Web Web
Mobile Mobile
Server Server

The Google global site tag (gtag.js) is a JavaScript tagging framework and API that allows you to send web conversions to Google Ads. With the Segment Google Ads (Gtag) destination, Segment loads gtag.js for you so you can make efficient use of your existing tracking implementation.

Only use this destination if your Google Ads account is using Gtag. If you’re using Google Tag Manager, don’t add the global site tag (gtag.js) in your GTM containers. You should also disable any Google Ads (Classic) destinations within the same source, since Google Ads (Classic) can’t load at the same time as Google Ads (Gtag).

If you’re sending enhancement data to Google Ads in parallel with Gtag, you must include the same Order ID (Transaction ID) on both sets of data. This is required to properly deduplicate conversions between Gtag conversions and enhanced conversions. To send Order ID (Transaction ID) to Gtag, include order_id as a property on your web events.

Consent mode

Google enforced consent on March 6, 2024 for European Economic Area (EEA) users. Learn more about consent mode and how to set it up.

Getting Started

You can use this destination to map your .page() calls to Page Load Conversions or .track() calls to Click Conversions. Currently this is only supported on the browser.

Configure the Google Ads (Gtag) destination

  1. From the Segment Destinations Catalog find and select Google Ads (Gtag).
  2. Click Configure Google Ads (Gtag).
  3. Select the source you will use to send data to Google Ads (Gtag).
  4. Provide a meaningful name to this instance of the destination.
  5. On the destination Settings tab, enter the Conversion ID from your Google Ads (Gtag) account.
  6. Select the ‘Click Conversion’ setting. Enter the name of the event as it appears in the track call and map it to your Google Ads (Gtag) conversion label.

Consent mode is a feature provided by Google in the context of its products, particularly the Gtag library and Google Analytics. As of March 6, 2024, Google announced that consent mode must function for European Economic Area (EEA) users, otherwise data from EEA users won’t process.

Consent mode in the Gtag library and Google Analytics is designed to help website owners comply with privacy regulations, such as the General Data Protection Regulation (GDPR) in the European Union. It allows website owners to adjust how these tools use and collect data based on user consent.

With consent mode, you can configure your website to dynamically adjust the tracking behavior of the Gtag library and Google Analytics based on the user’s consent status. If a user provides consent to data processing, both the Gtag library and Google Analytics can collect and use that data for analysis. If a user doesn’t provide consent, both tools limit data collection to essential functions, helping businesses respect user privacy preferences.

Consent mode may involve updates to your sources outside of Segment, such as incorporating a consent management system for consent functionality.

To enable consent mode for your Google Ads (Gtag) destination, you can choose from 2 implementation options.

  • Option 1:
    1. Set the consent defaults by implementing the ready() method to set consent defaults.

         analytics.ready(function() {
           window.gtag('consent', 'default', {
             'ad_storage': 'granted',
             'ad_user_data': 'granted',
             'ad_personalization': 'granted',
             'analytics_storage': 'granted'
           });
         });
      
    2. Use your Consent Management Platform to prompt the visitor. Ask the visitor to grant or deny consent for the applicable types (for example, analytics, advertising).

    3. Pass the information to Gtag.js by calling gtag inside the Segment ready() method.

         analytics.ready(function() {
           window.gtag('consent', 'update', {
             'ad_storage': 'denied',
             'ad_user_data': 'granted',
             'ad_personalization': 'denied',
             'analytics_storage': 'granted'
           });
         });
      
  • Option 2: Create an instance of the Google Analytics 4 Web destination, to set up consent in your GA4 Web destination, which loads a gtag with consent preferences. If you’re already using Google Analytics 4 Web on the same page, you just need to configure the consent mode settings once. There’s no need to create another instance of GA4 Web.

If you have any questions setting up consent mode, reach out to friends@segment.com.

Page

If you want to map all your unnamed .page() calls to a default Page Load Conversion, you can enter the Conversion ID in Settings > Default Page Conversion. However, if you created specific Page Load Conversions in Google Ads that you’d like to map your named .page() calls in Segment, you can map the events in Settings > Page Load Conversions.

Segment forwards all the properties of the page call, such as path, title, url, because by default, Google Ads (Gtag) makes these available in your remarketing campaigns.

You can send Google’s semantic properties, such as value, currency, or transaction_id, as integration specific options. However, Segment recommends you to create a Click Conversion instead, and map them to .track() calls. The example below shows these properties as integration-specific options:

analytics.page({}, {
  'Google Adwords New': {
    value: 25,
    currency: 'USD',
    order_id: 'order123'
  }
});

NOTE: The 'Google Adwords New' is case sensitive. Segment prefers you to use order_id rather than transaction_id to stay more consistent with the ecommerce spec. However, Segment will send it as transaction_id in the request itself to satisfy Google’s specifications.

Track

You can map your custom .track() events to any Click Conversions you created inside Google Ads. Segment passes any properties so you can use them during your remarketing campaigns.

If you pass properties.value, properties.currency, or properties.order_id, Segment maps them to Google’s semantic value, currency, or transaction_id respectively.

The only exception is that for Order Completed events, Segment will map Google’s semantic value field to your properties.revenue or properties.total. If you pass both as properties, properties.revenue takes precedence.

Troubleshooting Google Ads Conversions

To figure out if an event is flagged for conversion, follow these steps:

  1. Confirm that the events mapped to a Google Ads conversion are being sent in device-mode while using the Segment Analytics.js library. To do this:
    1. Go to Connections > Sources in your workspace and choose your Source.
    2. Go to the Debugger tab.
    3. Click on an event and look at the Raw view to make sure the events have a library name of analytics.js. There should be a snippet of code that looks like this:
         "library": {
           "name": "analytics.js",
    
  2. Verify that the Google Conversion ID in your Segment workspace is correct.
  3. Find your ad online and click it. This will redirect you to your website.
  4. Open the Network tab in your browser and make sure the Preserve log checkbox is checked and All is selected. Keep this Network tab and webpage open.

    Network tab

  5. Go to the Settings tab for your Gtag destination in Segment on a new webpage and choose Click Conversions to look at the mapped track() events and make sure the events are mapped to the correct Conversion Label.

The conversion label is unique to each conversion action and is configured per mapping. You can find the conversion label in the event snippet. The event snippet should have send_to: 'AW-123456789/AbC-D_efG-h12_34-567'. The conversion label is the part after the ‘/’.

  ![Edit Settings](../../images/conversion-settings.png)
  1. Go back to your website and trigger the event mapped to the conversion. For example, as shown in the image above, it would be Order Completed.
  2. Go to the Network tab in your browser and enter the Conversion Label linked to the event you triggered in the Filter field.

    Network tab

  3. See if the value for the ct_cookie_present changed to true. If true, it means that Google Ads counts the event as a conversion.

Google Ads considers an event as a conversion when the user arrives to your website as a result of an Ad click. The Google SDK is responsible for checking if the user came from an Ad click and sets the parameter ct_cookie_present to true. Without clicking through an ad, Google Ads doesn’t reflect the conversion because this information is missing in the network requests.

Multiple Google Ads Accounts

If you are an enterprise that uses multiple Google Ads Gtag accounts (usually managed by various third party agencies) you can override the top level default Google Conversion ID at the event level by entering it into the settings.

Remarketing Support

Google offers two primary types of remarketing:

  • Standard Remarketing : allows advertisers to show targeted ads to users who have previously visited their website. Advertisers can create custom remarketing lists based on user behavior, such as pages viewed or specific actions taken on the website.
  • Dynamic Remarketing : takes personalized advertising a step further by showing users specific products or services they viewed on an advertiser’s website. This type of remarketing is particularly beneficial for e-commerce businesses as it displays dynamic product ads to previous visitors, reminding them of products they showed interest in.

Google Ads (Gtag) Destination does not support Dynamic Remarketing

Segment’s Google Ads (Gtag) Destination only supports Standard Remarketing.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
Google Conversion ID
(required)
string. Enter your GOOGLE-CONVERSION-ID. You can get this value from your global site tag snippet. It should look something like AW-901243031
Click Conversions mixed, defaults to .

You can map your .track() events to specific Google Ads Click Conversions by providing your event name and the Conversion ID.
Conversion Linker boolean, defaults to TRUE .

If you don’t want the global site tag to set first-party cookies on your site’s domain, you should disable this setting. Disabling this is NOT recommended by Google as it can lead to less accurate conversion measurements.
Default Page Conversion string. If you want to map all your default .page() calls that do not explicitly pass in a name to a conversion event, you can enter the Google Ads Conversion ID here.
Disable Ad Personalization boolean, defaults to FALSE .

Enable this setting to to disable the collection of remarketing data for users who do not wish to view personalized ads. When enabled, Segment will set the allow_ad_personalization_signals tag parameter to false. For more information about disabling the collection of remarketing data see Google’s documentation here.
DoubleClick Floodlight ID string. Enter your DoubleClick Floodlight Advertiser ID to have it passed to Gtag’s config parameter. This ensures tags are loaded by first-party cookies. This value should look like DC-1234567. For more information, see Google’s documentation.
Page Load Conversions mixed, defaults to .

You can map your .page() calls to specific Google Ads Page Load Conversions by providing your page name and the Conversion Label.
Send Page View boolean, defaults to TRUE .

If you want to prevent the global site tag from automatically sending a remarketing hit to your Google Ads accounts when the page is viewed, you can disable this setting. Otherwise, by default all properties sent with the conversions will be sent as remarketing hits which will allow you to create audiences based on those properties.

This page was last modified: 07 Aug 2024



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account