我可以使用“dataLayer”吗?捕获“购买”的代码批量处理订单/会员费时来自网站后端的事件?

发布于 2025-01-17 03:51:47 字数 608 浏览 2 评论 0原文

是否可以在我的网站上使用 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苏辞 2025-01-24 03:51:47

我最终找到了实现这一目标所需的东西;我猜谷歌将其称为“测量协议”,用于在服务器到服务器之间发送事件。

测量协议 - 将事件服务器发送到服务器

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文