Keep Your TMS Tagging Simple

Over the past 6-8 months I’ve seen so many tutorials on how to do nifty tricks in tag management systems.

Reformat your URL with a simple JS snippet!

Dynamically grab menu text with jQuery!

Customize your search result query string!

Tag management systems can do all of this (and more), but before we implement tags we’re missing a key step: thinking. Is using your tag management system really the best way to rewrite URL’s that you’re passing into Google Analytics or should you just use an advanced filter? Do you need to write jQuery to get the text() parameter or can you just grab the innerHTML attribute? I get that it’s easy and it’s quick, but it’s not always the right way to approach the problem (see: golden hammer).

Remember that adding JavaScript, jQuery, or Sizzle creates dependencies. You’re putting your data at risk when you leverage custom code in your TMS. What if the elements you are targeting change? Your rule might break, meaning you could lose data. What if your tech team moves a library from the header to the footer? If you’re using a function in the header that requires the library, your rule will break! What if you suck at coding? Your rule might break. Additionally, some code slows down your page load speed. Do you like that fancy jQuery method you’re loading at the top of the page to update your page name? Well, it’s likely several dozen times slower than running JavaScript. Better yet, why not take care of the page name in the admin?

The moral of the story is that while it is easy, fun, and convenient to use custom code in a TMS to make your data look pretty – it isn’t always the best solution. Use custom coding as a LAST RESORT and you’ll save yourself from headaches in the future.

2 thoughts on “Keep Your TMS Tagging Simple”

  1. In some companies all custom code has to be reviewed by it or developers. So not using custom code can make the approve of your rules faster.


Leave a Comment