Skip to content

Instantly share code, notes, and snippets.

View dhirajbajaj's full-sized avatar

Dhiraj Bajaj dhirajbajaj

View GitHub Profile
class @GoogleAnalytics
@load: ->
# Google Analytics depends on a global _gaq array. window is the global scope.
window._gaq = []
window._gaq.push ["_setAccount", GoogleAnalytics.analyticsId()]
# Create a script element and insert it in the DOM
ga = document.createElement("script")
ga.type = "text/javascript"
@jameslafa
jameslafa / _footer.html.erb
Created May 27, 2014 12:55
Rails 4 - Google analytics with Turbolinks