检测是否通过 Google Analytics API 启用了 Google Analytics 电子商务跟踪
默认情况下,Google Analytics 会禁用电子商务跟踪。
是否可以通过 Google Analytics 数据导出 API 检查相关帐户中是否启用了电子商务跟踪?
By default, Google Analytics disables eCommerce Tracking.
Is it possible to check, via the Google Analytics Data Export API, whether or not e-Commerce Tracking is enabled in the account in question?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
据我所知,没有办法单独检测它是否已打开。
您可以查看 Google Analytics API 提供的 XML 响应:http:// /ga-api-http-samples.googlecode.com/svn/trunk/src/ ;似乎它们中的任何一个都没有暴露实际设置。
我在我的一个应用程序中检测到它的一种方法是简单地打开尽可能早的日期范围并检查交易计数(指标:
ga:transactions
,不需要维度) 。如果大于 0,则启用电子商务交易。但是,如果交易等于 0,则可能意味着电子商务已启用但未处于活跃使用状态。有趣的事实:您实际上可以在不启用电子商务跟踪的情况下使用它;谷歌分析将收集并保存数据;一旦启用它,您之前发送的所有电子商务数据都将在那里。奇怪的是,启用或禁用电子商务跟踪的选项似乎实际上只是一个 UI 设置,而不是一个真正的选项。
As far as I can tell, there is no way to detect solely if it is turned on.
You can checkout the XML responses that the Google Analytics APIs provide: http://ga-api-http-samples.googlecode.com/svn/trunk/src/ ; it does not appear that any of them expose the actual setting.
The one way that I've detected it in one of my apps is to simply open up the date range as far back as possible and check the count transactions (Metric:
ga:transactions
, no Dimension necessary). If that's greater than 0, eCommerce Transactions are enabled. However, if transactions are equal to 0, it could mean that eCommerce is enabled but not in active use.Fun fact: You can actually use eCommerce Tracking without enabling it; Google Analytics will collect and preserve the data; once you enable it, all of your priorly sent eCommerce data will be there. Bizarrely, it seems that the option to enable or disable eCommerce Tracking is really just a UI setting, rather than a real option.
它更有可能出现在 Google Analytics Managment API 中,但我也看不到
http://code.google.com/apis/analytics/docs/mgmt /mgmtFeedReference.html
It would had more chance to be in the Google Analytics Managment API, but I can't see it either
http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html
我们看看:http://developers .google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/profiles/list
并查看:
电子商务跟踪 = {$profile->getECommerceTracking()}
增强型电子商务跟踪 = {$profile->getEnhancedECommerceTracking()}
Well have a look at: http://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/profiles/list
and look at:
eCommerce tracking = {$profile->getECommerceTracking()}
Enhanced eCommerce Tracking = {$profile->getEnhancedECommerceTracking()}