在谷歌分析中,如何从AccountEntry获取网站?

发布于 2024-08-28 06:20:37 字数 189 浏览 5 评论 0原文

在谷歌分析中,如何从 AccountEntry 获取网站?

看起来像这样,如果我这样做:

  • entry.getProperty(“ga:accountName”)
  • entry.getTitle().getPlainText()

我明白了。但这是正确的吗? 它记录在哪里?

in google analytics, how do I get the site from the AccountEntry ?

looks like that if I do:

  • entry.getProperty("ga:accountName")
  • entry.getTitle().getPlainText()

I get it. but is this correct ?
where is it documented ?

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

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

发布评论

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

评论(1

放飞的风筝 2024-09-04 06:20:38

查看 XML 帐户供稿参考,其中包含从 API 返回的所有数据。
此处 访问所有重要帐户提要信息的 Java 示例:

for (AccountEntry entry : accountFeed.getEntries()) {
    System.out.println(
      "\nWeb Property Id = " + entry.getProperty("ga:webPropertyId") +
      "\nAccount Name    = " + entry.getProperty("ga:accountName") +
      "\nAccount ID      = " + entry.getProperty("ga:accountId") +
      "\nProfile Name    = " + entry.getTitle().getPlainText() +
      "\nProfile ID      = " + entry.getProperty("ga:profileId") +
      "\nTable Id        = " + entry.getTableId().getValue() +
      "\nCurrency        = " + entry.getProperty("ga:currency") +
      "\nTimeZone        = " + entry.getProperty("ga:timezone") +
      (entry.hasCustomVariables() ? "\nThis profile has custom variables" : "") +
      (entry.hasGoals() ? "\nThis profile has goals" : ""));
  }

这是示例结果:

Web Property Id = UA-4276604-4
Account Name    = www.mainsite.net
Account ID      = 4246204
Profile Name    = www.systempuntoout.com
Profile ID      = 26084768
Table Id        = ga:26084768
Currency        = USD
TimeZone        = Europe/Rome

使用以下代码获取请求的站点:

entry.getTitle().getPlainText()

Have a look to XML account feed reference with all the data returned from the API.
Here a Java example that access all the important account feed information:

for (AccountEntry entry : accountFeed.getEntries()) {
    System.out.println(
      "\nWeb Property Id = " + entry.getProperty("ga:webPropertyId") +
      "\nAccount Name    = " + entry.getProperty("ga:accountName") +
      "\nAccount ID      = " + entry.getProperty("ga:accountId") +
      "\nProfile Name    = " + entry.getTitle().getPlainText() +
      "\nProfile ID      = " + entry.getProperty("ga:profileId") +
      "\nTable Id        = " + entry.getTableId().getValue() +
      "\nCurrency        = " + entry.getProperty("ga:currency") +
      "\nTimeZone        = " + entry.getProperty("ga:timezone") +
      (entry.hasCustomVariables() ? "\nThis profile has custom variables" : "") +
      (entry.hasGoals() ? "\nThis profile has goals" : ""));
  }

This is a sample result:

Web Property Id = UA-4276604-4
Account Name    = www.mainsite.net
Account ID      = 4246204
Profile Name    = www.systempuntoout.com
Profile ID      = 26084768
Table Id        = ga:26084768
Currency        = USD
TimeZone        = Europe/Rome

Use the following code to get the site as requested:

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