如何将 Google Ads Cookie 从服务器发送到 GTM 中的服务器容器?

问题描述 投票:0回答:1

我已经在 Google 跟踪代码管理器 (GTM) 中实现了服务器端标记,但我直接从后端代码发送 HTTP 请求,而不是在前端使用 JavaScript(与许多其他开发人员一样)。由于当从我的后端代码发送 HTTP 请求时,Meta 和 Google 设置的转化跟踪 cookie 不会自动发送,因此我从上下文中获取 _fbp 和 _fbc cookie 值,并将它们作为“ep.x-fb-”发送。 ck-fbp”和“ep.x-fb-ck-fbc”到 GTM 服务器容器,这使我能够成功跟踪 Facebook 广告转化。

我现在希望为 Google Ads 复制此流程。据我所知,对于 Google Ads 转化跟踪,GCLID 是一个设置 _gcl_aw cookie 的参数,我应该用它来跟踪转化。但是,我不确定如何在从服务器发送到 GTM 服务器容器的 Http 请求中发送此 cookie 值。

换句话说,如果我将 Meta 的 _fbc cookie 值作为“ep.x-fb-ck-fbc”参数发送,我应该如何发送 Google 的 _gcl_aw 和 _gcl_au cookie。

google-tag-manager google-ads-api adsense facebook-ads-api google-tag-manager-server-side
1个回答
0
投票
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.
© www.soinside.com 2019 - 2024. All rights reserved.