Auto login

2,355 views
Skip to first unread message

st...@willemsvastgoed.nl

unread,
Sep 16, 2009, 4:30:41 AM9/16/09
to google-analytics-api - GA Data Export API
Hello guys,

I want an external site with different kind of statistics. These are
from all different recourses, and google analytics is one of them.
Now i want to use an auto-login for the google analytics part.
I searched on internet and found this one:

<script type="text/javascript">
function d(t){document.write(t);};
d('<form name="googform" action="https://www.google.com/accounts/
ServiceLoginBoxAuth" method="post">');
d('<input type="hidden" name="continue" value="https://www.google.com/
analytics/settings/home">');
d('<input type="hidden" name="Email" value="***d="Email">');
d('<input type="hidden" name="Passwd" value="***d="Passwd">');
d('<input type="checkbox" name="PersistentCookie" style="display:none"
checked="checked" value="yes">');
d('</form>');
document.forms["googform"].submit();
</script>

This works, BUT it sends me to google analytics start page (I am
logged in :D). But this is not how i want it, it has to stay on the
same external page, and not at google analytics page.

I hope u understand my problem and u can help me with it.

Koopie

st...@willemsvastgoed.nl

unread,
Sep 16, 2009, 5:58:28 AM9/16/09
to google-analytics-api - GA Data Export API
Or is there an other way to login automatticaly without going to
google analytics page?

st...@willemsvastgoed.nl

unread,
Sep 16, 2009, 8:22:28 AM9/16/09
to google-analytics-api - GA Data Export API
Already found a way with an api from an other user.
> > Koopie- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Jerker

unread,
Sep 22, 2009, 9:04:57 AM9/22/09
to google-analytics-api - GA Data Export API
What way did you find? I've had the exact problem as you descibe...

miramardesign

unread,
Oct 2, 2009, 9:08:38 PM10/2/09
to google-analytics-api - GA Data Export API
Soo.. How did you do it? function name?? I find it rather frustrating
when people say their problem was solved but don't share it. I mean
this will come up in search results for years to come but the question
will never be answered.. :(
If your going to post back at least provide a link .

chrissky

unread,
Oct 4, 2009, 12:30:11 PM10/4/09
to google-analytics-api - GA Data Export API
I think the API documentation is fairly clear on how you establish
authentication and access tokens. Do you have a specific question
about that aspect of the API?
Always a good place to start is the oauth playground:
http://googlecodesamples.com/oauth_playground/

miramardesign

unread,
Oct 4, 2009, 1:10:35 PM10/4/09
to google-analytics-api - GA Data Export API
chrissky,

As the original poster wanted, I also need to have the client click a
link and let them forward inside their Analytics account. We setup
the accounts so we have user/pass in our db etc. We have been using a
client-side form that auto-submits via js but admittedly this is a bit
of a hack and doesnt always work so I am looking for an api way.
However this really is mislabeled since I don't want to export just
forward.

Thanks,

chrissky

unread,
Oct 5, 2009, 10:27:29 AM10/5/09
to google-analytics-api - GA Data Export API
Could you explain what you mean by "forward inside their analytics
account"?

miramardesign

unread,
Oct 5, 2009, 11:26:30 AM10/5/09
to google-analytics-api - GA Data Export API
chrissky
I am looking for the preferred google api way to do this.,

<a href="javascript:document.googleanalyticslogin.submit();">Click to
Login.</a>

<form name="googleanalyticslogin" action="https://www.google.com/
accounts/ServiceLoginBoxAuth" target="_blank" method="post">
<input type="text" name="Email" class="gaia le val" id="Email"
size="18" value="USERNAME" />
<input type="password" name="Passwd" class="gaia le val" id="Passwd"
size="18" value="PASSWORD" />
<input type="checkbox" name="PersistentCookie" value="no" />
<input type="text" name="rmShown" value="1" />
<input type="text" name="continue" value="https://www.google.com/
analytics/reporting/" /> <!-- here you can fill in the page that the
user sees when logged in -->
<input type="text" name="service" value="analytics" />
<input type="text" name="nui" value="1" />
<input type="text" name="hl" value="en-US" />
<input type="hidden" name="GA3T" value="oCGYxIWWGUE" />
<input type="submit" class="gaia le button" name="signIn"
value="Sign in"
/>
</form>

Upon clicking a link they end up in their account.

Thanks,

Claudio

unread,
Oct 5, 2009, 2:16:58 PM10/5/09
to google-analytics-api - GA Data Export API
Me, too...

We don't need to query the API, just a means to:

1) Authenticate the user with an analytics account
2) Redirect her to the default Analytics GUI

I can auth the analytics account with ClientLogin but after that, how
can I redirect the browser properly?
Tried direct linking, different CURL methods passing the auth token,
but AFTER properly authenticating with ClientLogin, trying to access
an url like
- http://www.google.com/analytics/home/
or
- https://www.google.com/analytics/reporting/?reset=1&id=[profile-id]

... still asks for the credentials to login.

So, like miramardesign asked, is there a preferred google api way to
do this?

miramardesign

unread,
Oct 5, 2009, 6:03:48 PM10/5/09
to google-analytics-api - GA Data Export API
Claudio,
It seems that they have been updating the form which also broke some
userscripts. (They are now generating the GALX parameter somehow)
http://userscripts.org/topics/36200?page=1#posts-176327



On Oct 5, 2:16 pm, Claudio wrote:
> Me, too...
>
> We don't need to query the API, just a means to:
>
> 1) Authenticate the user with an analytics account
> 2) Redirect her to the default Analytics GUI
>
> I can auth the analytics account with ClientLogin but after that, how
> can I redirect the browser properly?
> Tried direct linking, different CURL methods passing the auth token,
> but AFTER properly authenticating with ClientLogin, trying to access
> an url like
> -http://www.google.com/analytics/home/
> or
> -https://www.google.com/analytics/reporting/?reset=1&id=[profile-id]

Nick

unread,
Oct 5, 2009, 7:27:54 PM10/5/09
to google-analytics-api - GA Data Export API
Hi,

Just wanted to chime in here to say the Google Accounts API (which you
use to access the Google Analytics API) is different that the
authorization mechanism one uses to login to the Google Analytics User
Interface.

Currently there is no Google supported mechanism for programatically
logging users into the Google Analytics UI. Also if you do find a
solution keep in mind the urls Google Analytics uses can change at any
time, breaking your application.

-Nick

On Oct 5, 3:03 pm, miramardesign wrote:
> Claudio,
> It seems that they have been updating the form which also broke some
> userscripts.  (They are now generating the GALX parameter somehow)http://userscripts.org/topics/36200?page=1#posts-176327

miramardesign

unread,
Oct 5, 2009, 8:08:12 PM10/5/09
to google-analytics-api - GA Data Export API
Nick,
Thanks for the input and confirming what I suspected (although doubt
kept me looking)

st...@willemsvastgoed.nl

unread,
Oct 7, 2009, 4:45:30 AM10/7/09
to google-analytics-api - GA Data Export API
Auto login isnt working anymore in IE8.
And, google added a hidden field with a changing value every day.
> > > > do this?- Tekst uit oorspronkelijk bericht niet weergeven -

andrew perillo

unread,
Oct 12, 2009, 11:48:16 AM10/12/09
to google-analytics-api - GA Data Export API
did anyone find a solution to this?

On Oct 7, 9:45 am, "[email address]" wrote:
> Autologin isnt working anymore in IE8.
> > - Tekst uit oorspronkelijk bericht weergeven -- Hide quoted text -
>
> - Show quoted text -

Existentialist

unread,
Nov 24, 2009, 1:37:06 PM11/24/09
to google-analytics-api - GA Data Export API
*bump*

Can anyone share some tips as to how to 'land' at the 'final' analytic
page (where you choose a profile) after getting a token?

Nick

unread,
Nov 24, 2009, 3:06:59 PM11/24/09
to google-analytics-api - GA Data Export API
Hi,

There are 2 mechanisms for logging in to services at Google.

Through each products home page via Google Accounts. This is a manual
process and there is no way to automate this and could be a security
threat if you do hack around it.

Through the Google Accounts API token mechanism. This is what the API
uses and these tokens do not work with the manual process above.

-Nick

Existentialist

unread,
Nov 25, 2009, 1:24:00 PM11/25/09
to google-analytics-api - GA Data Export API
I'm using the API way to get access to GA. Let me rephrase the problem
I have as I'm a bit confused with what everyone else is talking
about...

So when someone clicks on a link, it will send them straight to the GA
UI page (i think that's what you guys call) logged in with the account
information "I" provided (the company's GA page).

First of all, is it even doable? If so, which auth method to use? I've
managed to get a token via clientlogin but I have no clue what request
to send back. I'm not interested in "feeds" but a way to access the GA
UI page.

Hope that makes it a bit clearer and any feedback is appreciated.

Nick

unread,
Nov 25, 2009, 4:53:51 PM11/25/09
to google-analytics-api - GA Data Export API
Hi,

Thanks for clarifying. There is no supported way to auto login a user
through Google Accounts through the Web User Interface and send them
onto Google Analytics.

If a user has gone to google.com and logged in through Google Accounts
themselves, they can book mark a report in GA. If the are still logged
into the same Google Account the user can use that book mark to link
directly to a report without having to re login.

There is no automation of this process.

Thanks,
-Nick

pbernardo

unread,
Nov 26, 2009, 10:08:08 AM11/26/09
to google-analytics-api - GA Data Export API
Thank you Existentialist for the clarification...is as simple as that.
I was already making a drawing... ;)
And thank you google for not allowing us to impress our clients with
the possibility to integrate the autologin feature in our CMS
applications.

http://www.askapache.com/webmaster/login-google-analytics.html

yeah..Thanks a lot !!

pbernardo
> > > > > > > authorization mechanism one uses tologinto the Google Analytics User
> > > > > - Show quoted text -- Ocultar texto citado -
>
> - Mostrar texto citado -

Existentialist

unread,
Nov 26, 2009, 12:28:45 PM11/26/09
to google-analytics-api - GA Data Export API
Alright then, at least I gave API a shot. Time to hack around it...
Reply all
Reply to author
Forward
0 new messages