VOOZH about

URL: https://support.google.com/sa360/answer/9165554?hl=en&ref_topic=7550510

⇱ Cross-domain conversion tracking - Search Ads 360 Help


Skip to main content

Use the Google tag

Cross-domain conversion tracking

To measure activity when your customer journeys span two or more related sites across multiple domains, add the domain linker to your Google tags.

For example:

  1. An online retailer has country-specific stores but a single site for processing purchases.
  2. A customer visits example.store.co.uk, clicks the purchase button in the shopping cart, and is sent to the example.store.com domain to complete the transaction.
  3. To link the conversion on example.store.com to the visit on example.store.co.uk, the retailer adds the domain linker to the Google tags on both sites.

The domain linker shares 1st party measurement cookies between your source domain and your destination domain. The 1st party measurement cookies are stored in a web browser, and can only be accessed by pages on the same domain.

On this page

  1. How to use the domain linker
  2. What does the set linker command do?

How to use the domain linker

To use the domain linker, add gtag('set', 'linker' {domains}) to your Google tags. Add the command to all pages in your source domain that can send visitors to your destination domain, and specify the destination domain in the command's domains property:
gtag('set', 'linker', {
'domains':
['destination-domain.com']
});

To streamline tag maintenance, consider adding the command to all pages on your sites and listing all of your domains in the command's domains property. This enables you to use the same command on all of your pages and ensures that conversions can be properly measured regardless of the direction of links across your sites.

Continuing the example of the online retailer, here's a Google tag with a set linker command that names both domains:

<!--
Start of global snippet: Please do not remove
Place this snippet between the <head> and </head> tags on every page of your site.
-->
<!-- Google tag (gtag.js) - DoubleClick -->
<script async src="https://www.googletagmanager.com/gtag/js?id=DC-1234567"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};

gtag('set', 'linker', {
'domains':
['example.store.co.uk', 'example.store.com']
});

gtag('js', new Date());

gtag('config', 'DC-1234567');
</script>
<!-- End of global snippet: Please do not remove -->
Note: To ensure that set values are available for config commands and available to any dynamically-loaded containers, add the set command above the js command in your Google tag.

What does the set linker command do?

The gtag('set', 'linker' {domains}) command adds a URL parameter named _gl to URLs on the page that point to a domain listed in the command. When the Google tag on the destination page update this URL parameter, it extracts the 1st party measurement cookie and stores it, which shares the 1st party measurement cookie between your source domain and your conversion domain.

Continuing the example of the online retailer:

  1. The gtag('set', 'linker' {domains}) command on the shopping cart page adds the_gl parameter to the URL that points to the conversion domain:
    https://example.store.com/purchase/?_gl=1~abcde5~
  2. When the link reacheshttps://example.store.com/purchase, the Google tag on that page extracts the 1st party measurement cookie and stores it.

Learn more about measuring customer journeys across domains.

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Google apps
Main menu
4783355191380395022
true
Search Help Center
false
true
true
true
true
true
5055977
false
false
false
false
false