Eloqua Tracking & Google Tag Manager
How to add Eloqua Tracking to Google Tag Manager in 60 seconds.
One of the first things clients want to do when they start implementing Eloqua is to set up Eloqua Asynchronous web tracking so they can start gathering information about their contacts website visits.
For those of you that don’t know what Eloqua Asynchronous web tracking is here a link to the Oracle documentation.
(https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAA/pdf/AsynchronousVisitorTrackingScripts.pdf)
When you go into settings and request it, Eloqua gives you some standard out-of-the-box tracking script which they then advise you to add to the head of each website page you want to track. This works perfectly until someone from the web team says, we use Google Tag Manager, can we add it to that?
Usually the Eloqua Admin will say sure, and hand over the tracking script.
This is where the problem starts. If you just add the tracking script as it comes it won’t work. Google Tag manager doesn’t recognize some of the code that Eloqua tracking script uses. Rather than go into the details of why it doesn’t work I’ll give you the fix.
Guide: Adding Eloqua Tracking Script to Google Tag Manager
Step 1. Download your Eloqua tracking script from Eloqua.
Get your Eloqua tracking script. Assets > Website Setup > Tracking
Click on Generate Visitors Tracking Scripts
Finally click on Generate at the bottom right part of the page. Eloqua will send you your tracking script to your email address. When you get it, make sure you unzip the zip file properly. Don’t just open the folder and drag the text file with the Eloqua tracking script onto your desktop. Occasionally it throws errors for some reason when you do this.
Step 2. Eloqua Tracking Script Modification
Open up your Eloqua Tracking Script in Notepad or an HTML editor. You will now see your Eloqua Tracking Script.
<script type="text/javascript"> var _elqQ = _elqQ || []; _elqQ.push(['elqSetSiteId', 'xxxxxxxxx']); _elqQ.push(['elqTrackPageView']); (function () { function async_load() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//img.en25.com/i/elqCfg.min.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (window.addEventListener) window.addEventListener('DOMContentLoaded', async_load, false); else if (window.attachEvent) window.attachEvent('onload', async_load); })(); </script>
You need to replace the last two lines of the Eloqua tracking script with a single line of code.
<script type="text/javascript"> var _elqQ = _elqQ || []; _elqQ.push(['elqSetSiteId', 'XXXXXXXXX']); _elqQ.push(['elqTrackPageView']); (function () { function async_load() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//img.en25.com/i/elqCfg.min.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } async_load(); //modified for Google Tag Manager })(); </script>
You now have your modified ELoqua Tracking Script ready for Google Tags.
Step 3. Send to Web Team
Send you modified Eloqua tracking script to your web team so they can add it to a new Custom HTML tag in your Google Tag Manager Container. Once complete you need to set the tag to fire when the DOM is loaded.
You have now added Eloqua Tracking Scripts to Google Tag Manager:
Job Done.
Let's talk Eloqua!
Agency Secrets: Types of Email Opt-ins for B2B Marketing
I get asked about email opt-ins constantly—and the truth is, this post has everything you need to get your head around it. Different countries have different rules, and yes, it does matter how you collect emails. But before you spend money on another agency meeting...
Agency Secrets: How much should lead source reporting for every lead/campaign/sale really cost you?
Warning: Are You Being Overcharged by Your Marketing Automation Agency? If you've been billed or quoted more than $3600, or if the work took more than 18-26 hours (3-4 working days) by a marketing automation agency, you might be paying far more than you should....
Agency Secrets: How much should a GDPR/CCPA/PECR-Compliant Cookie Banner really cost you?
Warning: Are You Being Overcharged by Your Marketing Automation Agency? If you've been billed or quoted more than $1500, or if the work took more than 6-24 hours (2-3 working days) by a marketing automation agency, you might be paying far more than you should. Contact...
Eloqua Technical: How to capture exactly which campaign, medium, etc, a lead used to come on to your website even though they navigated around several pages before conversion.
I got asked by a subscriber how they could track UTM parameters on the first touch to their website from all mediums, campaigns, etc because contacts where coming to their website, navigating around and then submitting forms. After I helped them they no longer had a...
Brilliant – thank you very much.
Hi there! Thanks for this helpful information. It worked for us when we were using third party tracking scripts in GTM, but ever since we switched to first party scripts it no longer works. Any insight into making GTM work with a first party tracking script?
Hi Bethany,
apologies for not getting back to you sooner. Let me email you.
Hi Gr3g5ta,
I am interested in how to implement first-party tracking scripts in GTM. Any chance you can share?
Greg this article or post is great. But we followed what you showed and it did not work for us. We are using Eloqua first person tracking. Is there something different that needs to be done for this? Please advise and thank you for the great post.
Hi Greg, do you have any experience of tracking formLoad, formStart and formSubmit events in Google Analytics using a GTM container, for Eloqua forms?
Thanks.