如何使用 IPN(不是 PDT 收据页面)通过 PayPal 设置 Google Analytics 电子商务跟踪?

发布于 2024-12-20 02:23:37 字数 332 浏览 1 评论 0原文

我正在尝试设置 Google Analytics 电子商务跟踪。我很欣赏使用 PDT 可以相对轻松地完成此操作,但我找不到任何使用 IPN 页面来跟踪销售的参考(这是有道理的,因为用户从未真正访问过这些页面)。我们使用 IPN 来跟踪成功的订单,将跟踪与此结合起来是有意义的,因为这是标记成功订单的点。理论上,我们也可以使用 PDT 来跟踪销售,但这不会包含交易的所有信息,并且(更重要的是)当 PDT 变量传回时,销售可能尚未实际完成。对我来说,这使它不太理想,因为它并不总是完全正确的。有谁知道有什么方法可以通过 IPN 页面使用电子商务跟踪,或者这是不可能的(或由于其他原因不明智)?

一如既往地感谢大家,

戴夫

I am trying to setup Google Analytics Ecommerce Tracking. I appreciate this can relatively easily be done using PDT but I can't find any reference to using the IPN page to track the sales (which makes sense because a user never actually visits these). We use IPN to track the successful orders and it makes sense to tie the tracking in with this as this is the point that a successful order is flagged. We could in theory use PDT as well to track the sales but this will not contain all of the information for the transactions and (more importantly) the sale may not have actually completed when the PDT variables are passed back. To me this makes it much less desirable as it won't always be completely correct. Does anyone know of any way to use the ecommerce tracking via the IPN page instead, or is this not possible (or not sensible for another reason)?

Thanks so much as ever guys,

Dave

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

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

评论(1

忆沫 2024-12-27 02:23:37

我面临着同样的问题。解决方案的一部分可能会丢失一些交易,方法如下:

  • 当您设置订单 ID 时,在用户重定向到 Paypal 之前(或在最终篮子上),在用户的浏览器上设置 cookie。
  • 用户被发送到 Paypal
  • Paypal IPN 被触发
  • 用户返回您的网站(有一天,他会!)
  • 读取您在“我的帐户”页面上设置的 cookie,如果它与订单匹配:
    • Paypal 状态“已完成”:使用订单 ID 添加 Google 跟踪代码,然后删除 Cookie
    • Paypal 状态未“已完成”:请勿执行任何操作

它不是 100% 完美,因为某些交易可能永远不会被跟踪,但至少是执行跟踪代码的同一用户。

I'm facing the same issue. There could be a part of a solution, that could lose some transactions, by doing this:

  • set a cookie on the user's browser just before he's redirected to Paypal (or on the final basket), when you set your Order ID.
  • the user is sent to Paypal
  • Paypal IPN is triggered
  • user goes back to your website (one day, he will!)
  • read the cookie you've set, on your «my account» pages for example, and if it matches an order:
    • Paypal status «Completed»: add the Google tracking code, using order ID, then delete the cookie
    • Paypal status not «Completed»: don't do anything

It's not 100% perfect, as some transactions may never be tracked, but at least it's the same user who executes the tracking code.

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