简体   繁体   English

Google Analytics电子商务仅跟踪Paypal

[英]Google Analytics ecommerce only tracking Paypal

I'm having an issue with Google Analytics ecommerce tracking. 我在使用Google Analytics电子商务跟踪时遇到问题。 I've found numerous posts about this, but none of the fixes seem to apply. 我发现了很多关于此的帖子,但似乎都没有适用。 We're on Magento 1.5.0.1, so all the GA code should be built in. We also installed the Fooman GA+ module, but that didn't help this issue. 我们使用的是Magento 1.5.0.1,因此所有GA代码都应该内置。我们还安装了Fooman GA +模块,但这对这个问题没有帮助。 The tracking code IS showing up on the success page when viewing the page source, but it doesn't look right...no items listed. 在查看页面源时,跟踪代码IS显示在成功页面上,但看起来不正确...没有列出项目。 If I view the list of transactions in GA, it seems that they are all the Paypal transactions but credit card or money order transactions aren't coming through. 如果我查看GA中的交易清单,似乎它们都是Paypal交易,但信用卡或汇票交易并未通过。 We use Website Payments Pro for our Credit Card transactions, so ultimately it's all going through Paypal anyhow. 我们使用网站付款专业版进行信用卡交易,因此无论如何最终都会通过Paypal。

I did some digging around in the code and it seems that the "_getOrdersTrackingCode" function in Ga.php is where the problem lies. 我在代码中进行了一些挖掘,似乎Ga.php中的“_getOrdersTrackingCode”函数就是问题所在。 I added some logging... 我添加了一些日志...

$orderIds = $this->getOrderIds();
Mage::Log($orderIds);

...and found that the majority of the time, $orderIds is empty. ...并且发现大多数时候, $ orderIds是空的。 Sometimes it isn't and that is when the tracking code works. 有时它不是,也就是跟踪代码的工作原理。

What's going on here? 这里发生了什么? Anyone know? 谁知道?

I have fixed the problem. 我已经解决了这个问题。 We use a 3rd party extension for checkout and it needed to be updated for 1.5.0.1 compatibility. 我们使用第三方扩展程序进行结帐,并且需要针对1.5.0.1兼容性进行更新。 The dispatcher of the *checkout_onepage_controller_success_action* event needs to send an array of the order ids as well. * checkout_onepage_controller_success_action *事件的调度程序也需要发送一个订单ID数组。 This wasn't necessary in 1.4.2.0. 这在1.4.2.0中没有必要。 I updated the extension and it's working great now! 我更新了扩展程序,它现在运行得很好! I hope this helps anyone else with a similar issue. 我希望这可以帮助其他有类似问题的人。

Please note that this is an ORDER COMPLETE / SUCCESS event. 请注意,这是一个ORDER COMPLETE / SUCCESS事件。 You can't see the rendered code until you've completed a (test) transaction. 在完成(测试)事务之前,您无法看到呈现的代码。 On the order confirmation page, hit view source. 在订单确认页面上,点击查看源。 In your <script /> tag's you'll see some new push code if all goes well. 在你的<script />标签中,如果一切顺利,你会看到一些新的推送代码。

Yes, Brian, your code definitely lead us in the right direction. 是的,Brian,你的代码肯定会引领我们走向正确的方向。 We ended up turning the PayPal checkout to test mode = yes , debug mode = yes . 我们最终将PayPal结账转为test mode = yesdebug mode = yes We're on 1.4.2. 我们在1.4.2。 and this worked fine. 这很好。 Respond to this if you need help. 如果您需要帮助,请回复此问题。 If I'm alive, I will try to get back to you. 如果我还活着,我会尽力回复你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM