Passing GA Data through Eloqua Forms
Welcome to part three of my guide to integrating Google Analytics with Eloqua. If you have reached this page and want to read the first part of the guide (thoroughly recommended) then you can find it here: https://greg-staunton.com/eloqua-google-analytics-integration.
In this part of the guide I am going to take you through “Detecting UTM parameter values on landing pages and passing them to Eloqua”.
Introduction
If you have followed the steps 1 and 2 so far you will have a full understanding of what Google Analytics UTM parameters are, you will know exactly how to use for your campaign and you will have set up Eloqua correctly so you are passing back precisely what your web analytics team need, automatically, from all outbound Eloqua emails.
Now comes the fun part. You are going to update your campaign landing page so it automatically detects the UTM parameter values that are being passed over AND push that information back into Eloqua.
Detecting UTM parameter values on landing pages and passing them to Eloqua
There are two parts of Eloqua that are used to capture leads on landing pages:
- A form
- A landing page
Setting up your form
In this scenario you are only going to be asking for email. This is purely for the simplicity of this guide. In reality you will no doubt have all sorts of different questions you are using for gated content and no doubt use progressive profiling, etc.
You will build your form out as normal using the different contact and custom fields. After this you are going to need to build in another five custom fields to accommodate the five different Google Analytics UTM parameters that you wish to pass back to Eloqua.
Now you have set the hidden fields on your form you need to place it on the landing page. Next you need to set some JavaScript on your landing page which will pick up the UTM parameter values and populate the hidden fields on the form before submit.
Place the following script on your page:
var defaultHiddenFieldNameValue = "NoData"; function getQueryStringParamValue(strQStrParam) { var strURL = document.location.href; var strQStrParamValue = ""; if (strURL.indexOf('?') != -1) { strQStrParamValue = strURL.substr(strURL.indexOf('?') + 1); if (strQStrParamValue.indexOf(strQStrParam) != -1) { strQStrParamValue = strQStrParamValue.substr(strQStrParamValue.indexOf(strQStrParam)); strQStrParamValue = strQStrParamValue.substr(strQStrParamValue.indexOf('=') + 1); if (strQStrParamValue.indexOf('&') != -1) strQStrParamValue = strQStrParamValue.substr(0, strQStrParamValue.indexOf('&')); return strQStrParamValue; }else{ strQStrParamValue = defaultHiddenFieldNameValue; return strQStrParamValue; } }else{ strQStrParamValue = defaultHiddenFieldNameValue; return strQStrParamValue; } } var form = "MY_FORM"; //FORM NAME ON THIS LINE function setCampaign(){ var elqForm = document.forms[form]; //repeat for each field to populate elqForm.elements['utm_source'].value = getQueryStringParamValue('utm_source'); elqForm.elements['utm_medium'].value = getQueryStringParamValue('utm_medium'); elqForm.elements['utm_campaign'].value = getQueryStringParamValue('utm_campaign'); elqForm.elements['utm_content'].value = getQueryStringParamValue('utm_content'); } window.onload = setCampaign;
You are now automatically pulling the values from your UTM parameters straight into Eloqua!
Everything is not yet finished though… Whilst you can download your form submissions and have all the values in place there are other things we can do with this automatically.
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...
Hi Greg,
I just wanted to say thank you for your GA – Eloqua posts. I found these blog posts useful for any Eloqua specialist that is looking to integrate and leverage Google Analytics.
Keep up the good work
Kind Regards,
Costin Vieru
Hi Costin,
Thanks for the feedback. It’s kind words of encouragement from people like you that keep this all going. If you have any topics you want to suggest please let me know.
Regards
Greg
Hi Greg,
I’ve taken all the steps above to pass UTM parameter values over to hidden form fields in Eloqua but the UTM field data keeps coming over blank?? An idea what could be going on? Do you think the new responsive landing pages and forms could be causing the issue?
I will send you an email – lets go through this on a call. I don’t think it should take us too long – about half an hour?
Thanks for these posts Greg. Utilising the utm tag feature is a great step forward for me. I look forward to the other posts
Thanks Mark – I am glad I can help!