I have a javascript snippet that I need to inject on each page to fire off my google analytics. I tried using inject and keep getting errors:
inject("// load ga.js if it doesn't exist
if (!window._gat) {
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);
};")
What is the best way to approach this problem with tritium?