Skip to content

Instantly share code, notes, and snippets.

@boblail
Created February 26, 2011 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boblail/844911 to your computer and use it in GitHub Desktop.
Save boblail/844911 to your computer and use it in GitHub Desktop.
Isolates Google Analytics for Zombie to test
require 'rubygems'
require 'sinatra'
get '/ga' do
<<-HTML
<html>
<head>
<title>Google Analytics Test</title>
</head>
<body>
<h1>GA</h1>
</body>
<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">
var pageTracker = _gat._getTracker("UA-1656750-13");
pageTracker._trackPageview();
</script>
</html>
HTML
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment