Prelude [skip]
I’ve been using Google Analytics for a while now, both for this blog and my projects site, and as many others I think the service is great.
While creating my project site, I wanted to make sure that the site had graceful degradation, especially that the site would be accessible without javascript.
This introduced a new problem for me, even though visitors with javascript disabled where able to see the site rendered, their visits where not tracked in Google Analytics.
I stumbled upon a solution by Remy Sharp (see here), in the form of a plugin written in PHP for the popular WordPress blog engine, and with his permission I ported it to a .NET solution.
So what does this project do?
It generates a snippet that includes not only the regular Google Analytics script, but also a small <NOSCRIPT>
tag with an image loaded from Google’s servers, with parameters about the current request.
The result:
The visitor with a javascript disabled browser is tracked, and appended with “[NOSCRIPT]” for easy identification in the dashboard.
Project Components
The project includes three basic components:
-
Core Engine
Generates the snippets, either separately (for the NOSCRIPT, and the script), or the entire snippet -
ASP.NET MVC Html Helpers
|
|
- ASP.NET Web Forms
|
|
There’s also a small sample site, with both ASP.NET MVC and ASP.NET Web forms samples.
Where can I get it?
Visit the project page for more details.
Enjoy,
Erik