Sha256: 4dca745eeac6972a12671d44a31fd203e0482d4bf799da320efc46b93e2a9c10
Contents?: true
Size: 822 Bytes
Versions: 14
Compression:
Stored size: 822 Bytes
Contents
class Caboodle::Analytics < Caboodle::Kit description "Adds Google Analytics to every page of the site" required [:analytics_id] if ENV["RACK_ENV"] == "production" add_layout :after_body, "<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '#{analytics_id}']); _gaq.push(['_setDomainName', 'none']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>" end end
Version data entries
14 entries across 14 versions & 1 rubygems