Skip to main content

Posts

Showing posts from June, 2014

Sitecore and Universal Analytics

We recently moved from Google's Classic Analytics to Google's Universal Analytics, and I would like to share a few practices we used to make the transition easier. We have a Google markup Item we created in the content editor (simple text field) which we use to dynamically inject the UA code to the layout using a Literal that will accept the final <head> UA markup. Try to move all UA scripts from inline to a separate js file. This is a huge maintenance win for us as we have a central location where any UA changes can be made. The JS file basically is a "document.ready" script where all the elements and events we'd like to capture are placed. Use jquery's excellent 'binding' capabilities to be able to 'attach' an event to any specific element you have in your Sitecore pages.  We have another version of this same JS file that basically just contains pop-up alerts containing the actual UA call. This helps our SEO Analysts to check if th