我可以使用“dataLayer”吗?捕获“购买”的代码批量处理订单/会员费时来自网站后端的事件?
是否可以在我的网站上使用 dataLayer 代码来获取每月的会员计划费用?我的网站会自动处理此操作并向我的客户信用卡收费,因此我是否可以让我的开发人员添加此代码,以便当每个客户的信用卡收费时此数据层都会执行?
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "{invoice_id}",
value: {billable_amount},
currency: "USD",
items: [
{
item_id: "{invoice_id}",
item_name: "Membership Plan Fee",
price: {billable_amount}
}]
}
});
</script>
如果我在网站后端批量处理订单(其中为每个处理的订单触发类似的数据层),这是否也有效?
我是否需要将 GTM 跟踪代码添加到我网站的管理/后端才能正常工作?
谢谢你!
Is it possible to use dataLayer code on my website to capture monthly membership plan fees? My website processes this automatically and charges my customers credit card, so would I be able to have my developer add this code so when each customer's credit card is charged this dataLayer will execute?
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "{invoice_id}",
value: {billable_amount},
currency: "USD",
items: [
{
item_id: "{invoice_id}",
item_name: "Membership Plan Fee",
price: {billable_amount}
}]
}
});
</script>
Would this also work if I batch process orders on the backend of my website, where a similar dataLayer would fire for each order that is processed?
Would I need to add GTM tracking code to the admin/backend of my website for this to work?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终找到了实现这一目标所需的东西;我猜谷歌将其称为“测量协议”,用于在服务器到服务器之间发送事件。
测量协议 - 将事件服务器发送到服务器
I ended up finding what I need to use to accomplish this; I guess Google calls it Measurement Protocols for sending events server-to-server.
Measurement Protocols - Sending Events Server to Server