简体   繁体   English

从 Google Analytics API 获取视图/个人资料页面 url

[英]Get view/profile page url from Google Analytics API

I'm using the Google Analytics Management API to get a list of the user's profiles.我正在使用 Google Analytics Management API 来获取用户个人资料的列表。 Using the analytics.management.profiles.list endpoint I can get a lot of information about a user's profiles, but what I really want is a url to the page they would get if they signed into Google Analytics themselves and clicked on the profile from there.使用analytics.management.profiles.list端点,我可以获得很多关于用户个人资料的信息,但我真正想要的是一个指向他们自己登录 Google Analytics 并从那里点击个人资料时将获得的页面的网址. Is there a way to get this url?有没有办法得到这个网址? Previously, I was faking it with this url:以前,我用这个网址伪造它:

https://www.google.com/analytics/web/?authuser=3#report/visitors-overview/a{ACCOUNT ID}w{WEB PROPERTY ID}p{PROFILE ID}/

All the ids in curly braces were numbers that I just happened to notice match up with a profile's account, web property, and profile IDs.花括号中的所有 ID 都是我碰巧注意到与配置文件的帐户、网络资产和配置文件 ID 匹配的数字。

But I soon found that the authuser=3 part is specific to me;但我很快发现authuser=3部分是特定于我的; it refers to which of my several Google accounts I am accessing this page through.它指的是我通过哪些 Google 帐户访问此页面。

So is there a way to generate a url like that which works for anyone who is authenticated and has access to the profile they want to get to?那么有没有办法生成一个像这样的 url,它适用于任何经过身份验证并有权访问他们想要访问的个人资料的人?

As a disclaimer, I do not use Google Analytics myself and I don't have anything more than a superficial understanding of it, so please provide links and explain jargon if you can.作为免责声明,我自己不使用 Google Analytics,我对它的了解只是肤浅的,所以如果可以,请提供链接并解释行话。

It is actually possible to use authuser=myemail@gmail.com (or authuser=myemail@company.com ), using the email address of the account that you want to use to log in, regardless of the order you logged into your multiple accounts.实际上可以使用authuser=myemail@gmail.com (或authuser=myemail@company.com ),使用您要用于登录的帐户的电子邮件地址,无论您登录多个帐户的顺序如何.

That is also how I create Gmail/Calendar bookmarks that would always send me to the right inbox:这也是我创建 Gmail/日历书签的方式,这些书签总是将我发送到正确的收件箱:

I do not know, however, how to create a link to share with other people that'll work for everyone...但是,我不知道如何创建一个链接以与其他人共享,这对每个人都适用...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM