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 AskApache.info 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 domain.tld@gmail.com...


Log out After Adding new UserIn this example the username is askapache.info@gmail.com for the site AskApache.info, 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 AskApache.info Analytics Account</a>

The invisible form

<form id="googleanalyticslogin" action="https://www.google.com/accounts/ServiceLoginBoxAuth" method="post">
<input type="text" name="Email" class="gaia le val" id="Email" size="18" value="me@gmail.com" />
<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="http://www.google.com/analytics/web/?et=reset&hl=en-US" />
<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" />
</form>

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!



Google

Comments