Solved

Google Analytics - Auto login

Posted on 2010-08-28
3
1,748 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
MrPete_ earned 500 total points
ID: 33549536
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
ID: 33555390
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
 

Author Closing Comment

by:sabecs
ID: 33874664
Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

752 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