Solved

Google Analytics - Auto login

Posted on 2010-08-28
3
1,710 Views
Last Modified: 2012-05-10
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
Comment
Question by:sabecs
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
MrPete_ earned 500 total points
Comment Utility
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
 

Author Comment

by:sabecs
Comment Utility
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&amp;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
 

Author Closing Comment

by:sabecs
Comment Utility
Thanks.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
An overview of how to create reports in Adobe Analytics (formerly Omniture Site Catalyst) using pageNames, events, eVars and props. This video will show you how to install the Omniture Debugger tool so can see (and test) what is being passed int…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now