non-gmail account can't access analytics

1,185 views
Skip to first unread message

TomH

unread,
May 6, 2009, 11:34:53 AM5/6/09
to google-analytics-api - GA Data Export API
Hi,

When I try to access the profiles from a non-gmail account I get the
following error:

No Analytics account was found for the currently logged-in user

I use this url https://www.google.com/analytics/feeds/accounts/default

I use my current email address which has access to several analytics
accounts, what could be the problem here? Some setting wrong?

Thanks!

Nick

unread,
May 6, 2009, 1:20:07 PM5/6/09
to google-analytics-api - GA Data Export API
Hi,

Can you provide more information....

How are you trying to access the service - Through a 3rd party built
application or by making requests to the API?
Also is your email address also linked to an Apps for your domain
account?

-Nick

On May 6, 8:34 am, TomH wrote:
> Hi,
>
> When I try to access the profiles from a non-gmail account I get the
> following error:
>
> No Analytics account was found for the currently logged-in user
>
> I use this urlhttps://www.google.com/analytics/feeds/accounts/default

TomH

unread,
May 8, 2009, 9:30:04 AM5/8/09
to google-analytics-api - GA Data Export API
Hi,

Yes trying to use the java client library

as.setUserCredentials(account.getEmail(), account.getPassword());
AccountFeed accountFeed = as.getFeed( new URL("https://www.google.com/
analytics/feeds/accounts/default"),
AccountFeed.class);

like that..

It is indeed also part of a Google apps for domain account.

Nick

unread,
May 8, 2009, 1:36:15 PM5/8/09
to google-analytics-api - GA Data Export API
Hi,

Currently Google Apps for you Domain and Google Accounts are
different. You can actually have the same username but different
passwords across each. GA only supports Google Accounts and not logins
tied to Apps for your domain. This restriction is the same for the UI
as well as the API.

I would try logging into the GA UI, and using those credentials as
strings in your code below.

-Nick

TomH

unread,
May 10, 2009, 6:20:11 PM5/10/09
to google-analytics-api - GA Data Export API
Hi,

The email is both a Google account (which has access to analytics) and
a Google Apps for Domain account. Both share the same credentials so I
am using the correct credentials. However when I use the sample from
the interactive samples and try to login I see the email twice in the
list. One which has the analytics accounts and one which doesn't have.

Is there a way to tell the API to use the Google account version or
does it automatically try the google apps for domain version first?

Thanks!

Nick

unread,
May 11, 2009, 1:24:54 PM5/11/09
to google-analytics-api - GA Data Export API
Hi Tom,

Determining which account to use is done when you authenticate. Which
method are you using?

If it's Client Login, make sure you set accountType to GOOGLE :
http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#ClientLogin
If you use HOSTED_OR_GOOGLE, you will get a token for your apps for
your domain user which GA will not recognize.

-Nick

TomH

unread,
May 15, 2009, 9:16:25 AM5/15/09
to google-analytics-api - GA Data Export API
Hi,

I just use the java client library, like

as.setUserCredentials(account.getEmail(), account.getPassword());
AccountFeed accountFeed = as.getFeed( new URL("https://
www.google.com/
analytics/feeds/accounts/default"),
AccountFeed.class);

I'll try your suggestion though thanks!

Tom

On 11 mei, 19:24, Nick wrote:
> Hi Tom,
>
> Determining which account to use is done when you authenticate. Which
> method are you using?
>
> If it's Client Login, make sure you set accountType to GOOGLE :http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#C...

Luis Peralta

unread,
Jun 24, 2009, 6:13:38 AM6/24/09
to google-analytics-api - GA Data Export API
Hi Tom,

Did you finally get to authenticate with a Google Apps for you
domain account? I'm using the gdata-client-python module and any
access my data keep failing.

If I set the authentication type to 'GOOGLE' I'm getting a
gdata.service.BadAuthentication exception. If I set it to 'HOSTED',
I'm getting 'No Analytics account was found for the currently logged-
in user'.

The code:

acc_service.ClientLogin(username="xx...@11870.com",
password="XXXX",
account_type='HOSTED')

Any clues?

Nick

unread,
Jun 24, 2009, 4:35:12 PM6/24/09
to google-analytics-api - GA Data Export API
Hi,

Just to chime in......GA does NOT support 'HOSTED' authentication from
accounts tied to Google Apps.
The UI doesn't support it, the API doesn't support it.

Also to note, even using the Authentication type HOSTED_OR_GOOGLE will
also not work since if a user does have the same email tied to a
Google Account and a Google Apps account, the Authentication API will
first attempt the HOSTED version, receive a token, and GA will not
recognize it.

Today if you want to use the API, you must use 'GOOGLE'
-Nick

On Jun 24, 3:13 am, Luis Peralta wrote:
> Hi Tom,
>
>    Did you finally get to authenticate with a Google Apps for you
> domain account? I'm using the gdata-client-python module and any
> access my data keep failing.
>
>    If I set the authentication type to 'GOOGLE' I'm getting a
> gdata.service.BadAuthentication exception. If I set it to 'HOSTED',
> I'm getting 'No Analytics account was found for the currently logged-
> in user'.
>
>    The code:
>
>  acc_service.ClientLogin(username="[email address]",

TomH

unread,
Jun 25, 2009, 4:11:55 AM6/25/09
to google-analytics-api - GA Data Export API
Hi,

Yes Nick's suggestion resolved my issue:

as.setUserCredentials(username, password,
ClientLoginAccountType.GOOGLE);

Hope this helps for you as well.

Tom

On 11 mei, 19:24, Nick wrote:
> Hi Tom,
>
> Determining which account to use is done when you authenticate. Which
> method are you using?
>
> If it's Client Login, make sure you set accountType to GOOGLE :http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#C...

Tatarenkov Pavel

unread,
Jul 12, 2009, 1:36:58 PM7/12/09
to google-analytics-api - GA Data Export API
Thanks Nick, Tom,

Your advice helps me as well.

Pavel.

Jeff Gonzalez

unread,
Aug 27, 2009, 4:36:43 PM8/27/09
to google-analytics-api - GA Data Export API
I am having this same problem, but I am currently using the GOOGLE
account type.

I have written an application that utilizes the Reimers Google
Analytics library for accessing the GA Data Export. Everything was
working up until this Monday when I stopped being able to find
accounts within my account (via the API, everyone works fine on the GA
website).

To ensure that the Reimers library was not at fault, I started using
Fiddler to initiate build the appropriate requests.

To recreate the problem, what I am doing is using Fiddler to create a
POST request to the following url:

https://www.google.com/accounts/ClientLogin
User Agent:Reimers.dk Token Requestor
Content Type:application/x-www-form-urlencoded

In the body of the request I put the following string, with
<ValidAccount> and <ValidPassword> replaced with the appropriate
data.

accountType=GOOGLE&Email=<ValidAccount>&Passwd=<ValidPassword>&source=reimers.dk-
analyticsreader-0.1&service=analytics

This request succeeds (Status 200) and I am issued a set of tokens,
sid, lsid and auth. I am using the auth token to create a GET request
to the following url:

https://www.google.com/analytics/feeds/accounts/default
User Agent:Reimers.dk Token Requestor
Authorization: GoogleLogin auth=<Auth Token Goes Here>

Whenever I execute the GET request I am given a 401 and the response
has "No Analytics account was found for the currently logged-in user."

Any ideas as to what the problem could be?

Jeff Gonzalez

unread,
Aug 27, 2009, 4:46:09 PM8/27/09
to google-analytics-api - GA Data Export API
I wanted to add that I am doing this for more than one Google
Analytics account, I believe 5 in total. 3 Accounts work fine and
have no problems accessing the API, but two of them have this exact
same issue.
Reply all
Reply to author
Forward
0 new messages