Do you want to add the Eloqua (Marketing automation) tracking script to your Microsite through Google Tag Manager?
If you want to add the Eloqua (Marketing automation) tracking script to your Microsite through Google Tag Manager?
The first step is to make sure you have your Google Tag manager deployed on your microsites. Please chat with us if you don't yet.
If you simply place the out-of-the-box Eloqua code in GTM, it will not work! You will have to make a slight tweak to your Eloqua tag, and GTM will dpeloy it correctly.
Here’s how to make your Eloqua script compatible with Google Tag Manager:
1. Get your Eloqua tracking script. It should look something like this (Your code should have a numerical value in place of ‘xxxxxxxxx’).
2. Edit the code as follows: Replace the last two lines (if
and else if
statements, bolded above) with a single call to the async_load()
function.
In the original script, these two lines determine when the Eloqua tracker fires. However, it is listening for an event (DOMContentLoaded or onload) which has potentially occurred before GTM fires the tag. Instead, we can remove this listener and use a DOM Ready firing rule (see Step 4), allowing GTM to control when the Eloqua tracker fires.
3. Place the revised code in a new Custom HTML tag in your GTM container.
4. Set the tag to fire when the DOM is loaded by creating a new trigger.
Create a new trigger and select the Trigger Type as Page View – DOM Ready.
5. Save your changes, create a new container version, and publish!