How do I implement double tagging using xtcore.js?

The xtcore.js tag is not optimized for use in double tagging. It is based on a set of global variables that are concatenated and sent as a hit when the xtcore.js file is loaded.

If you wanted to use two tags on the same page, you would need to place the main tag and the xtcore.js file in separate JavaScript files (called on each page of your site) to avoid any conflicts between the two. If you didn't do this, the global variables would overwrite each other.

We also recommend using an anonymous function for each file in order to fully differentiate between the two tags. This will prevent xtcore.js' global variables from being truly global. There are of course other avenues you should feel free to explore with your dev team to find the one most suited to your needs and your site.

We recommend migrating to SmartTag, if possible, in cases of double tagging.

The smarttag.js file, in contrast to the xtcore.js file, manages several Tracker instances well as long as they are set up following the documentation.

Have more questions? Submit a request