Skip to main content
All CollectionsFor WebTag Configuration
Global Tag Code – customising your tag
Global Tag Code – customising your tag
Updated over 11 months ago

There are many reasons to add global code to your tag. This article addresses how (not why).

How to add Global JS code to your tag

Launch the top-nav, and enter Tag Configuration

Edit your live tag

Find the pre-init section

Paste your code in

Then save the modal and your tag.

Your changes will take a while to propagate through the CDN – it’s unlikely to be instant and these times will fluctuate throughout the tag.

Multiple Tag Configurations

In Webtrends Optimize, you have the ability to create Draft tag configurations so you can check your work. You can activate these using the query string _wt.context=optimize: e.g. https://www.webtrends-optimize.com/?_wt.context=optimize:mydrafttag

Script load times available

Pre-init

This is the only place we recommend you add scripts. It’s the first thing to load, and ideal for adding items into the datalayer.

Pre-load

This executes just before your tests are evaluated, but some initial processes will have already happened.

Post-load

This executes after the Optimize library has triggered and tests have been requested (but not run).

Did this answer your question?