在谷歌分析中,我如何从 AccountEntry 获取网站?
如果我这样做,看起来像这样:
- entry.getProperty("ga:accountName")
- entry.getTitle().getPlainText()
我得到它。但这是正确的吗?它在哪里记录?
在谷歌分析中,我如何从 AccountEntry 获取网站?
如果我这样做,看起来像这样:
我得到它。但这是正确的吗?它在哪里记录?
查看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()