Automate User Login to SmarterStats

SmarterStats offers the ability to create a link that an end user can click to atuomatically log into their SmarterStats site. This can be incredibly useful if an end user has multiple sites or if you have a portal page that your customer logs into before accessing any other information.

The HTML code below demonstrates how you can make a text link (e.g. "See Your Stats") to automatically log a person in to the SmarterStats application. By putting a hidden form on a simple web page, you can fill in the "Site ID", "Username" and "Password" information via hard coding the data or through a scripting language like ASP, ASP.Net or ColdFusion.

For the example code listed below, we have the form values set to generic text (e.g. "put_their_siteid_or_domain") to show where you would hard code values that are submitted to the login.aspx page. You could also dynamically generate these values using a scripting language like ASP or ColdFusion (a sample ASP script would substitute value="put_their_siteid_or_domain" with value=<% =txtSiteID %>). The form action shown (http://127.0.0.1:9999/smarterstats/login.aspx) uses the default location of the SmarterStats Web Interface. If you have created a separate web site for SmarterStats, or assigned a different IP address for SmarterStats within IIS, this action would have to be altered to reflect this change. This example demonstrates how easy and powerful the SmarterStats application is in allowing companies to automate entry into the application.

 

<html>
	<head>
		<meta http-equiv="Content-Language" content="en-us">
		<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
		<title>SmarterStats Login Title</title>
	</head>
	
	<script type="text/javascript">
		function GoToStats() {
		document.statsform.submit();
		}
	</script> 

	<body>
	    <form name="statsform" action="http://127.0.0.1:9999/Login.aspx" method="post">
                <input type="hidden" name="shortcutLink" value="autologin" id="shortcutLink">
	        <input type="hidden" name="txtSiteID" id="txtSiteID" value="put_their_siteid_or_domain">
	        <input type="hidden" name="txtUser" id="txtUser" value="put_their_username">
	        <input type="hidden" name="txtPass" id="txtPass" value="put_their_password">
	    </form>

            <p><a href="JavaScript:GoToStats()">Log into your stats</a></p>

	</body>
</html>

 

Learn more about SmarterStats, one of the best Google Analytics alternatives.