Skip to content

Google Ads

This guide shows you how to set up Google Ads Conversions and Google Ads Remarketing using Server-side Google Tag Manager.

Prerequisites

Before you begin, ensure you have the following:

Benefits of Server-Side Tagging with Google Ads

  • Improved Data Accuracy: Server-side tagging bypasses ad blockers and browser privacy restrictions (like Safari's ITP or Firefox's ETP), resulting in more reliable and complete conversion data.

  • Improved Website Performance: Moving tracking tags from the user's browser to your server significantly reduces the amount of code that needs to load, resulting in faster page load times. This single, efficient data stream also consolidates requests, improving overall site speed and the user experience.

  • Enhanced Data Control: You decide exactly what data to share with Google, allowing you to enrich or anonymize information to comply with privacy regulations (GDPR/CCPA). Shifting tagging from the browser to the server may also reduce the load on the JavaScript thread in the browser, improving site speed and Web Vitals, which can positively impact SEO.

Rollout plan

Create a Conversion Linker tag, as well as a Google Ads Remarketing and Google Ads Conversion tag.

The Conversion Linker tag is essential for Google Ads to accurately measure conversions on your website. It captures ad click data from the landing page URL and stores it in a first-party cookie on your domain. This process ensures conversion data is not lost due to browser privacy restrictions on third-party cookies. It must fire on all pages of your site to correctly link ad clicks to subsequent conversions.

The Google Ads Remarketing tag is used to create audience lists from your website visitors. It tracks user behavior and sends this data to your Google Ads account, enabling you to target ads to people who have previously engaged with your site. This tag is crucial for both standard and dynamic remarketing campaigns, allowing you to show relevant ads to past visitors.

The Google Ads Conversion tag measures specific user actions on your website, such as purchases or form submissions. It works by sending a signal to your Google Ads account, crediting the conversion to the ad that a user originally clicked. This data is critical for understanding which ad campaigns are effective and for optimizing bidding strategies.

The final state will then capture a user journey like the one pictured below. The Conversion Linker tag will make sure the user's ad click ID is preserved. The Remarketing tag will register the user's interest for a specific product and finally, the Conversion tag will provide feedback about the advertising campaign's success to Google Ads.

Server GTM Google Ads data flow

Step 1: Set up the Conversion Linker tag

  1. In your server-side GTM container click Tags - New.

  2. Choose the Conversion Linker tag type from the list of built-in tags.

  3. Check Accept incoming linker parameters (Optional)
    This setting tells the server-side tag to look for and process linker parameters (like _gl) from the incoming URL. You should enable this when your user journey spans multiple domains and you need to pass ad click information from one site to another for accurate attribution.
    If you only have a single domain or if your users never switch between domains, you can leave this unchecked.

  4. Check Override cookie settings (advanced) (Optional)
    This option gives you manual control over the name, domain, and path of the first-party cookie set by the tag. You should only use this for highly specific, complex use cases, such as preventing cookie naming conflicts or restricting a cookie's scope to a particular subdomain. Most use-cases do not require a change in this setting.

  5. Set up the Triggering.
    The Conversion Linker tag must fire on every incoming request that potentially contains the ad click information. The best practice is to use a trigger that fires on all Page View requests (or equivalent), such as the All Pages trigger in the server container.

  6. Give your tag a descriptive name (e.g., "Conversion Linker") and Save it.

Step 2: Set up the Google Ads Remarketing tag

  1. If you have Google Ads Remarketing Tags in your GTM Web Container you want to migrate to the server-side Tagmanager, use the Google Ads Conversion ID from your Google Ads Remarketing Web Tag, otherwise:

    1. Retrieve your Google Ads Conversion ID:

      1. In your Google Ads account, go to Tools & Settings - Shared Library - Audience Manager.

      2. Click on Your Data Sources and find the Google Ads tag card.

      3. Click Details and then navigate to Tag Setup.

      4. Under the Use Google Tag Manager section, you will find your Conversion ID. Copy this ID.

  2. Create a New Google Ads Remarketing Tag in the Server Container:

    1. Click Tags in the left-hand navigation and then click New.

    2. Choose the Google Ads Remarketing tag type from the list.

    3. In the Tag Configuration, paste the Conversion ID you copied from your Google Ads account.

  3. Configure Dynamic Remarketing (Optional)
    The Send dynamic remarketing event data option is used to pass specific product and user data with the remarketing event. You should enable this when you want to show highly personalized ads to users based on the products or content they interacted with on your website.

    1. In the Google Ads Remarketing tag configuration, check the box for Send dynamic remarketing event data.

    2. Under Data Source, the default Event Data should be sufficient if your dataLayer and GA4 events follow the recommended e-commerce schema (e.g., view_item, add_to_cart). The tag will automatically pull parameters like item_id, value, and currency.

    3. If your dataLayer schema is not standard, you can choose Custom configuration and manually map the Google Ads parameters (ecomm_prodid, ecomm_pagetype, etc.) to variables from your incoming GA4 event data. You'll need to create User-Defined Variables in your server container to extract these values from the GA4 event data stream.

  4. Enable Restricted Data Processing (Optional)
    You should enable Restricted Data Processing to help comply with privacy laws like the CCPA, which allows users to opt out of the sale of their data. When enabled, this setting signals to Google to limit how it uses a user's data, preventing it from being used for personalized advertising.

  5. Enable Provide Custom Parameters (Optional)
    The Provide Custom Parameters setting allows you to send additional, non-standard data with your Google Ads events. Use this when you need to send specific, custom information to Google Ads for reporting or audience building that isn't included in the default event data, such as a user's subscription tier or a product's brand.

  6. Enable Provide User ID (Optional)
    The Provide User ID option lets you send a user's unique identifier to Google Ads. If you have a proprietary user ID, you can use it to enable cross-device and cross-platform tracking, which helps Google accurately attribute conversions and build remarketing lists for users who are signed in across different devices.

  7. Conversion Linking: Make sure Enable Conversion Linking is set to true.

  8. Configure the Trigger.
    In the Triggering section, select the trigger that fires on All Pages or the equivalent. In a server container, this is usually a trigger that fires on all GA4 clients or all incoming requests that are identified as a page_view event.

  9. Give your tag a descriptive name (e.g., "Google Ads Remarketing") and Save it.

Step 3: Set up the Google Ads Conversion tag

  1. If you have Google Ads Conversion Tags in your GTM Web Container you want to migrate to the server-side Tagmanager, use the Google Ads Conversion ID and Conversion Label from your Google Ads Remarketing Web Tag.

    Otherwise, retrieve Conversion Information from Google Ads:

    1. In your Google Ads account, go to Tools & Settings - Measurement - Conversions.

    2. Select the conversion action you want to set up (e.g., "Purchase" or "Form Submission").

    3. Click on the conversion action name to see its details.

    4. Expand the Tag setup section and choose Use Google Tag Manager.

    5. Here, you will find your Conversion ID and Conversion Label. Copy both of these values.

  2. Create a New Google Ads Conversion Tag in the Server Container:

    1. Click Tags in the left navigation, then click New.

    2. Choose the Google Ads Conversion Tracking tag type.

    3. In the Tag Configuration, paste the Conversion ID and Conversion Label you retrieved from Google Ads.

  3. Configure Event Data:

    1. Conversion Value: This field is used for conversions with a monetary value, like a purchase.

      1. To make it dynamic, click the + icon and select a variable from the list. This variable should be a User-Defined Variable that extracts the transaction value from the incoming GA4 event data (e.g., from the value parameter).
    2. Currency Code: Add a variable that pulls the currency code from the incoming GA4 event data.

  4. Enable Restricted Data Processing (Optional)
    You should enable Restricted Data Processing to help comply with privacy laws like the CCPA/GDPR, which allows users to opt out of the sale of their data. When enabled, this setting signals to Google to limit how it uses a user's data, preventing it from being used for personalized advertising.

  5. Enable Provide Product-Level Sales Data (Optional)
    The Provide Product-Level Sales Data option allows you to send detailed information about the products in a transaction to Google Ads, not just the total conversion value. You should use this for e-commerce sites to unlock advanced reporting in Google Ads, such as revenue and profit by product, cart size, and cross-sell patterns, which are crucial for optimizing Shopping and Performance Max campaigns.

  6. Enable Provide New Customer Data (Optional)
    The Provide New Customer Data setting allows you to identify whether a user making a purchase is a new or returning customer. You should use this to inform Google Ads' bidding strategies and campaign reporting, allowing you to optimize for acquiring new customers, which are often more valuable than returning customers.

  7. Conversion Linking: Make sure Enable Conversion Linking is set to true.

  8. Configure the Trigger. In the Triggering section, select or create a trigger that fires only for a specific conversion event, such as a purchase.

  9. Give your tag a descriptive name (e.g., "Google Ads Conversion") and Save it.

Step 4: Troubleshooting and Publishing

Use the server-side GTM's Preview Mode to thoroughly test and debug the tags, ensuring they fire at the correct time and send the expected data. This proactive step helps avoid data discrepancies and ensures accurate campaign measurement. After reviewing the Tags, publish your workspace.

Note

Make sure to disable or delete the Google Ads Tags in your Web GTM Container, if you were reproducing them in your server-side Tag Manager.