Google Analytics.NET

 

ASP.NET MVC Usage

<%= Html.GoogleAnalytics("UA-xxxxxx-x")%>
 

Results in

<!-- Google Analytics --> 
 
<script type="text/javascript"> 
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." 
		|-> : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + 
	|-> "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script> 
 
<script type="text/javascript"> 
    try {
        var pageTracker = _gat._getTracker("UA-xxxxxx-x");
        pageTracker._trackPageview();
    } catch (err) { } 
</script> 
 
<noscript> 
    <img src="http://www.google-analytics.com/__utm.gif?utmwv=1
	|-> &utmn=938102714&utmsr=-&utmsc=-&utmul=-&utmje=0
	|-> &utmfl=-&utmdt=-&utmhn=localhost&utmr=-&utmp=
	|-> /[NOSCRIPT]&utmac=UA-xxxxxx-x&utmcc=__utma%3D938102714
	|-> .2068565733.1256572500.1256572500.1256572500.2%3B%2B__utmb
	|->	%3D938102714%3B%2B__utmc%3D938102714%3B%2B__utmz
	|-> %3D938102714.1256572500.2.2.utmccn%3D(direct)%7Cutmcsr%3D
	|-> (direct)%7Cutmcmd%3D(none)%3B%2B__utmv%3D938102714.-%3B"
	alt="GA" style="display: none;border:none;" border="0" /> 
</noscript> 
 
<!-- Google Analytics End -->
 
There are also several overloads, allowing you to customize the parameters that reach the Google Analytics Dashboard
<%= Html.GoogleAnalytics(
	"UA-xxxxxx-x",//Google Analytics Account ID
	"CustomPageName",//Page name that will be displayed in the dashboard
	"custom.domain.com",//Domain to track
	"",//Referer
	"userVariable" //custom variable passed to the dashboard
		)%>
 
 
Change jQuery UI Theme
 
Loading GitHub Badge..
 
 
Blog
RSS
Twitter
 
Blog
RSS