开发者

How to get the Website URL with the Analytics Data Export API?

is the website URL开发者_如何学Go exposed by Analytics APIs ?

I can see the address in Analytics's own Account page ( such as https://www.google.com/analytics/settings/?pli=1#scid=XXXXX ) but I can't find it in the feed.

Am I missing something ?


You can use the Google Analytics Management API

Call the this API to enumerate your profiles:

https://www.googleapis.com/analytics/v3/management/accounts/{ACCOUNT_ID}/webproperties/{WEB_PROPERTY}/profiles

It has a websiteUrl property for your site's URL, and a defaultPage property for your default page.

If you don't have the ACCOUNT_ID or WEB_PROPERTY, you can call:

https://www.googleapis.com/analytics/v3/management/accounts

and once you extract your ACCOUNT_ID call the following to enumerate web properties:

https://www.googleapis.com/analytics/v3/management/accounts/{ACCOUNT_ID}/webproperties
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜