• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1815
  • Last Modified:

Google Analytics - Auto login

Hi,
I would like to create an auto login button to access Google Analytics for my customers, does anyone know if this can be done?  
0
sabecs
Asked:
sabecs
  • 2
1 Solution
 
MrPete_Commented:
Just to be clear: you question is CAN it be done. Good thing because depending on what you actually want, getting it done might be easy, or rather tricky (and something you may or may not be qualified to maintain!)

It all depends on what you really want. Your question is not sufficiently clear:

* Do you want this button on your customers' computers/websites, or is this for your convenience on your computer?
* Are you wanting a button that logs into the Google Analytics website, or ???

Depending on your answer, there are several paths.

1) Browser Remembers

The easiest thing is simply to have your web browser remember multiple login id's/passwords.

Then when you go to login at www.google.com/analytics, you can popup the available login id's, pick one, click once and you are in.

This is something almost anyone can do.

2) Write some software

If you REALLY want auto-login buttons, that's a bit trickier. Essentially, you need some kind of script or code that will feed the login/password info to Google, as if you had filled out the login form.

To do that, you need to be a programmer (or have a friend who can do it.)

One of the best tools for accomplishing this kind of thing is, unfortunately, only available for FireFox. It is called GreaseMonkey. There's info about it here: http://www.greasespot.net/

GreaseMonkey makes it possible to automate all kinds of things that you would normally do manually in your browser. And a WHOLE lot more... a savvy programmer can fix almost any problem on any webpage!

There are tons of existing script examples. None that do exactly what you might want, but just for example there's a script that automatically pushes the "Access Analytics" button. It's here: http://userscripts.org/scripts/show/35588

There are other scripts that automate logins of various kinds, Just search for "login" :)

Hope that answers your question about IF it can be done... and even gives you some ideas on HOW to get it done.

If you need more info than that, please explain your question more clearly :)
0
 
sabecsAuthor Commented:
Thanks Pete for your help,

At the moment I use the form below which works fine if I have the correct hidden fields, but apparently Google changes them on a daily basis

https://www.google.com/accounts/ServiceLoginBoxAuth
<input type="hidden" name="GA3T" value="4oCGYxIWWGUE">
<input type="hidden" name="GALX" value="g2BycIQxWzI">

Is there a way to automatically go to https://www.google.com/accounts/ServiceLoginBoxAuth get the hidden fields and substitute in my script, can this be done perhaps using JavaScript, jquery or PHP?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<a href="javascript:gi('googleanalyticslogin').submit();">Sign in to mywebsite.com 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="admin@ mywebsite.com" />
<input type="password" name="Passwd" class="gaia le val" id="Passwd" size="18" value="mypassword" />
<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/home/?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="g2BycIQxWzI">
<input type="submit" />
</form>
</body>
</html>

0
 
sabecsAuthor Commented:
Thanks.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now