Third Party Analytics

After hearing stories from Sitecore users and developers about the struggles they dealt with trying to manage third party tracking IDs (such as those used by Google Analytics) between environments and sites, and experiencing the headaches in my own development the creation of this control was born.

These required third party tracking values usually are injected in one of two ways. The first method commonly used is to place the tracking code directly on the main layout. This is easy as it ensures the tracking code shows for all pages and only loads once. The downfall is as source code migrates through environments or additional the organization grows and additional sites are added into Sitecore the management of proper tracking IDs become a developer challenge to maintain.

The second commonly employed method is the usage of a configuration file. A component is developed or code is placed directly in the main layout that reads the required ID values and even possibly some form of JavaScript snippets that are injected at page load. This method is a step in the right direction, but still requires the development team to be fully aware of the correct IDs for the environment and site. [This use to be my preferred method until I woke-up realizing there was a better way, which now sits in-front of you.]

A simple content driven component that can be placed on pages as needed allowing the content team to take ownership and manage the tracking ids, keeping the right idea by environment and by sites.

What’s Included in the GitHub repo

  • TDS project for Sitecore artifact syncing
  • Full source code to allow for extension with other third party applications
  • Sitecore package as found in _Documents folder
    • If you are running Sitecore 7.2, 7.5, 8.0, or 8.1 install the Sitecore package ‘’
    • If you are running Sitecore 8.2+ install the ‘’

Get the code with packages from GitHub at



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.