Sha256: 8b1ad41db7136e8497c092b80a6ece0140b5aa09bf51f1008e0e481f8bfcee59

Contents?: true

Size: 790 Bytes

Versions: 29

Compression:

Stored size: 790 Bytes

Contents

#	This file is part of the "Utopia Framework" project, and is licensed under the GNU AGPLv3.
#	Copyright 2010 Samuel Williams. All rights reserved.
#	See <utopia.rb> for licensing details.

require 'utopia/tags'

Utopia::Tags.create("google_analytics") do |transaction, state|
	html = <<EOF
<!-- 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(#{state[:id].dump});
pageTracker._trackPageview();
} catch(err) {}</script>

<!-- Google Analytics -->
EOF


	transaction.cdata(html)
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
utopia-0.9.56 lib/utopia/tags/google_analytics.rb
utopia-0.9.55 lib/utopia/tags/google_analytics.rb
utopia-0.9.54 lib/utopia/tags/google_analytics.rb
utopia-0.9.53 lib/utopia/tags/google_analytics.rb
utopia-0.9.52 lib/utopia/tags/google_analytics.rb
utopia-0.9.51 lib/utopia/tags/google_analytics.rb
utopia-0.9.50 lib/utopia/tags/google_analytics.rb
utopia-0.9.49 lib/utopia/tags/google_analytics.rb
utopia-0.9.48 lib/utopia/tags/google_analytics.rb
utopia-0.9.47 lib/utopia/tags/google_analytics.rb
utopia-0.9.46 lib/utopia/tags/google_analytics.rb
utopia-0.9.45 lib/utopia/tags/google_analytics.rb
utopia-0.9.43 lib/utopia/tags/google_analytics.rb
utopia-0.9.42 lib/utopia/tags/google_analytics.rb
utopia-0.9.41 lib/utopia/tags/google_analytics.rb
utopia-0.9.40 lib/utopia/tags/google_analytics.rb
utopia-0.9.39 lib/utopia/tags/google_analytics.rb
utopia-0.9.38 lib/utopia/tags/google_analytics.rb
utopia-0.9.37 lib/utopia/tags/google_analytics.rb
utopia-0.9.36 lib/utopia/tags/google_analytics.rb