How to send Google Ads cookies from server to server container in GTM?

61 views Asked by At

I have implemented server-side tagging in in Google Tag Manager (GTM), but I'm sending HTTP requests directly from my backend code, rather than using JavaScript on the frontend (as many other developers). Since, the conversion tracking cookies set by Meta and Google aren't automatically sent when sending a HTTP request from my backend code, I am getting the _fbp and _fbc cookie values from the context and sending them as a "ep.x-fb-ck-fbp" and "ep.x-fb-ck-fbc" to the GTM server container, which allows me to track Facebook ads conversions successfully.

I am now looking to replicate this process for Google Ads. I understand that for Google Ads conversion tracking, the GCLID is a parameter that sets the _gcl_aw cookie which I should use to track conversion. However, I am not certain how to send this cookie value in the Http request that I'm sending from my server to the GTM server container.

In other words, if I'm sending the Meta's _fbc cookie value as a "ep.x-fb-ck-fbc" parametar, how should I send the Google's _gcl_aw and _gcl_au cookies.

1

There are 1 answers

0
Krishan Kumawat On
  1. Use Google Analytics 4 with Server-side Tagging:

    Set up the Google Analytics: GA4 Configuration tag in your server container with the "Send to server container" option enabled. This will send relevant user data, including Google Ads campaign parameters, to your server container. Create a Conversion Linker tag in your server container to link user data across sessions and devices. Create a Google Ads Conversion Tracking tag in your server container to track conversions based on the data received from Google Analytics 4.

  2. Use User-defined Variables with Server-side Tagging:

    In your server container, set up a User-defined Variable to store the relevant data you want to send to your web container. This could be information extracted from Google Ads cookies or other server-side sources. Use a Custom HTML tag in your server container to push this User-defined Variable to the dataLayer on your website. In your web container, use a DataLayer Variable to access the pushed data and use it for your desired purposes, such as triggering other tags or creating custom audiences in Google Ads.

  3. Use Server-side APIs:

    Explore Google Ads Server-side APIs to manage conversion tracking and audience creation directly from your server-side code. This approach requires more technical expertise and development effort.