Home » Google » Auto-Login to Google Analytics to impress Clients

by 23 comments

Adding Google Analytics to clients' sites is a no-brainer, it ROCKS!

I have 100+ client web sites running Analytics and all of them have trouble-free (no password or username to remember) access to their site reports. Thanks to the method outlined in this post, my clients couldn't be happier.. about that at least :)

Special Thanks to Bowman Technology for coming up with a fix for problems people were having. I'm glad it still is a working technique, Thanks! BT.

Google Analytics Auto-Login Demo

Sign in to Analytics Account

5 Minute Install

Create New User for AccessOf course you need your own Google Analytics Administrator Account, if you don't already have one.

Then I add a non-admin user for each of my clients sites, making sure to only allow access to their individual accounts. I personally like using a naming system so that each new user's email address is

Log out After Adding new UserIn this example the username is for the site, pretty easy to remember huh!

Now all you need is the code to let your clients login without a username or password, because they prefer to roll down easy street whenever possible.

Get the form input values by logging in to google analyticsYou should be able to use the exact form code I have provided (view source), modifying only the username and password.

If you'd like you could use a Firefox add-on like Web Developer or Live HTTP Headers to view the form data. If you were really cool you would much prefer to use WireShark and view the HTTP protocol in detail. Basically you need to know the data that is sent to Google by the login form, then you can imitate that same data being sent by using a form on your own site.

The Code

The javascript is optional, you could just display the form if you want and use a form input to submit. The handy thing about keeping the form invisible and using a button with javascript is that you can have multiple hidden forms and multiple buttons. On the admin pages that I create for clients where I use this method, I have several other auto-login and other types of form submissions so its just easier.

The button

<a href="javascript:gi('googleanalyticslogin').submit();">Sign in to Analytics Account</a>

The invisible form

<form id="googleanalyticslogin" action="" method="post">
<input type="text" name="Email" class="gaia le val" id="Email" size="18" value="" />
<input type="password" name="Passwd" class="gaia le val" id="Passwd" size="18" value="Passw0rd" />
<input type="checkbox" name="PersistentCookie" value="yes" />
<input type="hidden" name="rmShown" value="1" />
<input type="hidden" name="continue" value="" />
<input type="hidden" name="service" value="analytics" />
<input type="hidden" name="nui" value="1" />
<input type="hidden" name="hl" value="en-US" />
<input type="hidden" name="GA3T" value="oCGYxIWWGUE" />
<input type="hidden" name="GALX" value="3Jces-nq404" />
<input type="submit" />

NOTE: I'm still waiting to hear from google whether or not they are OK with this method, so if anyone hears anything let me know!


Comments Welcome

Information is freedom. Freedom is non-negotiable. So please feel free to modify, copy, republish, sell, or use anything on this site in any way at any time ;)

My Online Tools

Popular Articles
Hacking and Hackers

The use of "hacker" to mean "security breaker" is a confusion on the part of the mass media. We hackers refuse to recognize that meaning, and continue using the word to mean someone who loves to program, someone who enjoys playful cleverness, or the combination of the two.
-- Richard M. Stallman

It's very simple - you read the protocol and write the code. -Bill Joy


Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

+Askapache | |

Site Map | Contact Webmaster | License and Disclaimer | Terms of Service | @Htaccess

↑ TOPMain