Google Analytics API:在个人资料 Feed 中包含个人资料域
使用 Google Analytics API,我想显示与每个 GA 配置文件关联的域。这是可能的还是有其他方法可以做到这一点?我一直无法找到该域的任何文档。
http://code.google.com/apis/analytics/docs /gdata/gdataReferenceAccountFeed.html#accountResponse
http:// /code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html#profileFeed
我无法使用 profileName,因为根据用户如何设置 GA 帐户,它可能只是一个字符串而不是一个域。
Using the Google Analytics API I would like to display the domain associated with each GA profile. Is this possible or is there another way to do it? I have been unable to find any documentation for the domain.
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html#accountResponse
http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html#profileFeed
I can't use profileName because depending on how the user has their GA account setup, it may just be a string and not a domain.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以做的一件事是使用 ga:hostnames 作为维度并使用 ga:visits 或 ga:pageviews 作为指标来执行查询。这将生成一个主机名图表(浏览器地址栏中的内容)以到达该站点。在某种程度上有点像黑客攻击。从技术上讲,您可以在多个网站上使用单个 GA 跟踪代码。因此,不存在与个人资料关联的“官方”域名。
One thing you might do is perform a query using ga:hostnames as the dimension and either ga:visits or ga:pageviews as metrics. This will yield a chart of the host name (what is in the browser address bar) to reach that site. Sort of a hack in a way. Technically you can use a single GA Tracking code on multiple sites. So there is no "Official" domain name associated with a profile.
不幸的是,我认为当前的 API 不可能做到这一点。此外,您不能明确依赖他们输入的域作为配置文件跟踪的唯一域,因为存在进一步的自定义,允许用户指定是否要跟踪子域和/或顶级域。我相信您唯一的选择是向用户询问 Google 向用户询问的相同信息,并帮助用户了解由于 Google API 的限制,他们必须手动保持两个列表同步。
Unfortunately, I don't think it's possible with the current API. Furthermore, you can't explicitly depend upon the domain they enter as the only domain the profile is tracking since there is further customization that allows the user to specify if they want to track subdomains and/or top-level domains. I believe your only option is to ask the user the same information Google asks the user and help the user understand they will have to manually keep two lists in sync due to limitations of the Google API.