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 massive black hole in their campaign analytics. Here is exactly how to do it.
Solution
Eloqua Conversion Tags using Google Tag Manager
Introduction
Let’s break this down. In this article I am going to prove 3 things:
- Add UTM marketing source parameters to a cookie to retrieve them later at the point of conversion.
- Take user submitted values from forms.
- Create a Javascript that will successfully send the above data to Eloqua.
I am glad to say that I was able to achieve all of these things technically, and this article outlines how that is achieved in GTM, and how it could be replicated across your entire website.
Get the UTM marketing source parameters into a cookie
This is achievable by creating a variable that takes values from query string, and then setting a cookie when these variables are detected.
Create new User-defined variables of type ‘URL’ and select component type ‘query’. Enter the key of the query string variable you want to use, eg: ‘utm_medium’.
Create a new trigger to fire on page load when ‘utm_medium’ does not equal ‘undefined’.
Create a tag to set the cookie referencing the query string parameters, eg:
document.cookie = “utmParams={{utm_medium}}_{{utm_source}}_{{utm_campaign}}_{{utm_content}}; path=/; domain=.acme.com;”;
In this example, the cookie will persist across all acme.com subdomains. You can then create a ‘1st party cookie’ variable in GTM which simply references the name of the required cookie.
User submitted values in the forms
Using the login page on a different subdomain from the main website I were able to create a custom javascript variable which referenced the field in the form we were interested in, eg:
This is achievable where form fields have specific IDs. Where not, we can also get these using GTM data layer variables, in this example:
gtm.element.2.value
Creating the conversion tag for Eloqua
The below code references the GTM variable {{Login Email}} and successfully sends it to Eloqua as a conversion. We can add more fields and add them to the string.
Using this example as a template, we could create tracking events for the various conversions on SSE and send the required data to Eloqua on each form submit.
var emailStr = ‘{{Login Email}}’
var htmlStr = ‘https://s25071713.t.en25.com/e/f2.aspx?elqFormName=GS_GTM_TEST&elqSiteID=25071713&EmailAddress=’ + encodeURIComponent(emailStr);
var req = new XMLHttpRequest();
req.open(‘GET’,htmlStr, true)
req.send()
Conclusion
This approach has been a great success for the client. They have razer sharp reporting no matter what the user does. We implemented some other things so we could record first and last touch for greater reporting capabilities though that is a story for another day.
Here is all the code you need to get this holy grail of tracking set up.
document.cookie = “utmParams={{utm_medium}}_{{utm_source}}_{{utm_campaign}}_{{utm_content}}; path=/; domain=.acme.com;”;
//this code references the ID of the email address field on the login form. We can replicate this for all form fields with an ID
function(){
var loginEmail = $(‘#Email’).val();
return loginEmail;
//This code sends the required URL to Eloqua, it’s just var htmlStr that needs to change for each different form
var emailStr = ‘{{Login Email}}’
var htmlStr = ‘https://s25071713.t.en25.com/e/f2.aspx?elqFormName=GS_GTM_TEST&elqSiteID=25071713&EmailAddress=’ + encodeURIComponent(emailStr);
var req = new XMLHttpRequest();
req.open(‘GET’,htmlStr, true)
req.send()
Let's talk Eloqua!
Eloqua Progressive Profiling 1: What is it?
Most clients I have ask me how they can quickly start doing Eloqua progressive profiling on their Eloqua landing pages. I hear you ask why? Easy, the Eloqua progressive profiling module is pony (pony is a slang UK English word for rubbish - fun fact for your day). ...
Eloqua Blog: Progressive Profiling and Cookie Opt-out
As more and more privacy laws creep in around the world you may be facing yourself with the dilemma of having to allow contacts to opt out of your Eloqua cookie getting dropped so you can track their website activity. I was asked an interesting question the other...
Eloqua Alert: Apple privacy update kills open rate
Eloqua Alert: Apple’s email privacy announcement means you need to rethink your email strategy What is Apple’s latest privacy announcement? Apple have just announced that they are going to be introducing a number of new privacy features and for Eloqua users...
Eloqua Persona Development: Return Path Case Study
What is an Eloqua Persona? Eloqua Personas are customer archetypes of typical, target users representing a group of people with shared behaviors, goals, pain points, and delighters (things that can make them happy). Eloqua Personas are different from marketing...