Professional Documents
Culture Documents
Table of Contents
Overview ............................................................................................................................2
Basic Page View Tracking .................................................................................................4
Basic Page View Tracking with First-Party Cookies ......................................................4
Tracking to Multiple Eloqua Instances ...........................................................................4
Tracking custom URLs/Referrers ..................................................................................7
Outbound Link Tracking .....................................................................................................8
Externally Hosted Forms ....................................................................................................9
Data Lookups ................................................................................................................... 11
Flash Content Tracking .................................................................................................... 13
Strict Mode Tracking ........................................................................................................ 16
Require opt-in for visitors by Country .......................................................................... 17
Require opt-in for all Visitors ....................................................................................... 18
Customizing the Opt-in/out Banner ............................................................................. 19
Opting-In/Out ................................................................................................................... 21
1 / 22
Overview
The Eloqua asynchronous tracking scripts allow you to track visits to your website seamlessly and without
affecting the page load time for your visitors. They are supported and tested in all major browsers, including:
o
o
o
o
o
In order to ensure the highest probability that Eloqua tracks the page before the visitor decides to leave the page
or move on to another, the scripts are executed after the entire Document Object Model (DOM) is loaded, but
before all content is loaded in all browsers (except IE8 and below). The DOM is the specification for how objects
in a Web page are represented (e.g. images, headers, links, etc.), and defines what attributes are associated with
each object, as well as how the objects and attributes can be manipulated. While the DOM is a standard,
different browsers support different levels of the DOM and Javascript standards. IE8 and below do not support
the event that indicates when the DOM has been completely loaded, and for those browsers, the entire page is
loaded before requests to the Eloqua servers are made.
Visitors are remembered based on a cookie value stored in their browser. There are two types of cookies: firstparty and third-party. How they are tracked in Eloqua varies from one to the other.
In the case of third-party cookies, upon the first request to a tracked website made by the visitor, a cookie with the
.eloqua.com domain is created and populated with a unique identifier, even if the website is not on the
eloqua.com domain. This unique identifier (GUID) does not contain any information about the visitor, and is only
used to correlate return visits by the same visitor. Unless the visitor clears cookies from the browser, this GUID
remains constant and will continue to track his or her online activity.
However, as is already the case with the Safari browser on Apples iOS platform, Mozilla, Microsoft and Google
may also consider blocking third-party cookies by default in Firefox, Internet Explorer and Chrome, respectively,
in the near future. When this occurs, this would prevent Eloqua from being able to track a visitors digital body
language. To get around this restriction, you can add tracking scripts to your web pages to enable first-party
cookies, with certain limitations:
It is not possible to use a first-party cookie to track a single visitors digital body language across multiple
domains owned by your organization. For example, suppose Oracle wishes to track a visitor on both
oracle.com and eloqua.com. While it was previously possible to use a single third-party cookie to
accomplish this, it is not possible using first-party cookies. In this instance, a separate first-party cookie
is required to track visitors activity on each domain as discussed in Basic Page View Tracking with FirstParty Cookies.
The chart below illustrates one scenario in which the new first- and third-party cookies affect tracking in Eloqua:
Visitor Action
Bob clears cookies in Firefox and browses to
marketing.oracle.com.
2 / 22
Visitor Action
Bob browses to www.oracle.com.
Bob browses to www.eloqua.com.
3 / 22
Strict Mode opt-in/opt-out preferences cannot be set using the Form Processing step.
The following options were implemented as of the Winter 14 release and continue to be supported in the
Summer 14 release:
4 / 22
tracking.mysite.com should be same as the first-party cookie domain in your configuration. Also
mysite.com should have the same root domain on which your webpages are hosted.
If your tracking script references //img.en25.com for the location of the hosted Javascript file, the only
modification you must make to the script is the line highlighted in blue below substituting
tracking.mysite.com with the first-party cookie tracking domain in your configuration:
<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', 'siteId']);
_elqQ.push(['elqUseFirstPartyCookie', 'tracking.mysite.com']);
_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>
_elqQ is a queue of commands to push to our servers. They are queued up and executed in order, once the
scripts have been loaded into the DOM, discussed later on in this document.
NOTE: The above snippet can be placed anywhere on the page. Since the scripts are executed asynchronously,
it does not matter where they are placed on the page. However, if you plan to use other features like data
lookups or opt-out pages, you must ensure _elqQ is defined before it is used.
Retrieving the Visitor GUID using a First-Party Cookie
The code snippet on the following page returns the visitor GUID:
5 / 22
function elqGetGuidCookieValue() {
var name, value, index, cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
index = cookies[i].indexOf('=');
if (index > 0 && cookies[i].length > index + 1) {
name = cookies[i].substr(0, index).trim();
if (name == 'ELOQUA') {
value = cookies[i].substr(index + 1);
var subCookies = value.split("&");
for (var l = 0; l < subCookies.length; l++) {
var subCookie = subCookies[l].split("=");
if (subCookie.length == 2 && subCookie[0] == 'GUID') {
return subCookie[1];
}
}
}
}
}
return '';
}
6 / 22
7 / 22
async_load, false);
else if (window.attachEvent) window.attachEvent('onload', async_load);
})();
</script>
If you would also like to override the referrer as well, adding a second parameter to elqTrackPageView()
allows you to do this:
<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', '123']);
_elqQ.push(['elqTrackPageView', 'http://www.mysite.com/downloads/',
'http://www.myreferrer.com']);
(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>
8 / 22
9 / 22
document.forms["EloquaFormName"].elements["elqCustomerGUID"].value =
GetElqCustomerGUID();
return;
}
timeout -= 1;
}
timerId = setTimeout("WaitUntilCustomerGUIDIsRetrieved()", 500);
return;
}
window.onload = WaitUntilCustomerGUIDIsRetrieved;
_elqQ.push(['elqGetCustomerGUID']);
This code will execute upon the page loading and will wait until the visitor's GUID has been retrieved from the
Eloqua servers and then insert it into the elqCustomerGUID form element. Be sure to replace
EloquaFormName with the actual name of your form as setup in the Eloqua application.
10 / 22
Data Lookups
Data lookups allow you to get information about a visitor, contact, data card, etc. to do things like auto-populate
forms, allow entry to a portion of your site to known contacts, and/or contacts who have already filled out a form,
etc.
To accomplish a data lookup, you will need the following:
1. Create a new data lookup key from within the Eloqua Application (see the Eloqua documentation for
how to do this).
2. Add the basic tracking scripts to your page.
Assuming you have completed steps 1 and 2 and have your Data Lookup key and optional Data Lookup value
ready, here's an example of how to retrieve that information:
For illustration purposes, we're going to create a simple div, and have it populated with some contact details by
the scripts. The first step is to add a div to our page in the main content section and give it an id of
contactinfo:
<div id="contactinfo">
</div>
Next, we need some JavaScript that will dynamically create some paragraph elements for us:
function CreateRow(label, value) {
var p = document.createElement('p');
var b = document.createElement('b');
p.appendChild(b);
b.appendChild(document.createTextNode(label));
p.appendChild(document.createTextNode(value));
document.getElementById('contactinfo').appendChild(p);
}
Next, we add a function called SetElqContent. This is the callback function that is called when the Eloqua
servers have responded and sent back the contact info. The function name is important and must be called
SetElqContent.
function SetElqContent() {
CreateRow('Contact Info: ', GetElqContentPersonalizationValue(''));
CreateRow('First Name: ', GetElqContentPersonalizationValue('C_FirstName'));
CreateRow('Last Name: ', GetElqContentPersonalizationValue('C_LastName'));
CreateRow('Email Address: ',
GetElqContentPersonalizationValue('C_EmailAddress'));
CreateRow('Salesperson: ', GetElqContentPersonalizationValue('C_Salesperson'));
CreateRow('Company: ', GetElqContentPersonalizationValue('C_Company'));
CreateRow('Address 1: ', GetElqContentPersonalizationValue('C_Address1'));
CreateRow('City: ', GetElqContentPersonalizationValue('C_City'));
CreateRow('State or Province: ',
GetElqContentPersonalizationValue('C_State_Prov'));
11 / 22
12 / 22
b.appendChild(label);
p.appendChild(value);
document.getElementById('contactinfo').appendChild(p);
}
function SetElqContent() {
CreateRow('Contact Info: ', GetElqContentPersonalizationValue(''));
CreateRow('First Name: ', GetElqContentPersonalizationValue('C_FirstName'));
CreateRow('Last Name: ', GetElqContentPersonalizationValue('C_LastName'));
CreateRow('Email Address: ',
GetElqContentPersonalizationValue('C_EmailAddress'));
CreateRow('Salesperson: ', GetElqContentPersonalizationValue('C_Salesperson'));
CreateRow('Company: ', GetElqContentPersonalizationValue('C_Company'));
CreateRow('Address 1: ', GetElqContentPersonalizationValue('C_Address1'));
CreateRow('City: ', GetElqContentPersonalizationValue('C_City'));
CreateRow('State or Province: ',
GetElqContentPersonalizationValue('C_State_Prov'));
CreateRow('Zip or Postal Code: ',
GetElqContentPersonalizationValue('C_Zip_Postal'));
CreateRow('Business Phone: ', GetElqContentPersonalizationValue('C_BusPhone'));
CreateRow('Country: ', GetElqContentPersonalizationValue('C_Country'));
CreateRow('Company Info: ', GetElqContentPersonalizationValue(''));
CreateRow('Checkbox: ', GetElqContentPersonalizationValue('M_CompanyName'));
CreateRow('Industry: ', GetElqContentPersonalizationValue('M_Industry1'));
CreateRow('Revenue: ', GetElqContentPersonalizationValue('M_Revenue1'));
CreateRow('WebSite: ', GetElqContentPersonalizationValue('M_WebSite1'));
CreateRow('Date Created: ',
GetElqContentPersonalizationValue('M_DateCreated'));
}
_elqQ.push(['elqDataLookup', escape('434C5E6250C04FCBB0D4FC5413F9A40A'),
'<C_EmailAddress>user@domain.com</C_EmailAddress>']);
</script>
</head>
<body>
<div id="contactinfo">
</div>
</body>
</html>
13 / 22
On your page that hosts the flash object, add the elqTrackFlashClick javascript function in the head section
below the standard tracking scripts:
<script type='text/javascript'>
function elqTrackFlashClick(URL, referrer) {
_elqQ.push(['elqTrackPageView', URL, referrer]);
}
</script>
Putting it all together, your page hosting the flash content might look like this:
<html>
<head>
<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', '<siteID>']);
_elqQ.push(['elqTrackPageView']);
14 / 22
(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);
})();
function elqTrackFlashClick(URL, referrer) {
_elqQ.push(['elqTrackPageView', URL, referrer]);
}
</script>
</head>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550"
height="400"
id="FlashExample" align="middle">
<param name="movie" value="FlashExample.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="FlashExample.swf"
width="550"
height="400">
<param name="movie" value="FlashExample.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img
15 / 22
src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
16 / 22
Eloqua's asynchronous tracking scripts allow you to implement Strict Mode Tracking. Eloqua's Strict Mode is a
set of tools that enables you to restrict visitor tracking according to laws enacted by European Union member
countries that have specified this requirement. Eloqua provides you with the following three levels for configuring
the tracking scripts:
1) Track all visitors;
2) Track all visitors except for those from countries on my Restricted Country List, unless those visitors have
opted into tracking (Require Opt-in for visitors by Country); or
3) Don't track any visitors unless those visitors have opted-into tracking (Require Opt-in for all Visitors).
It is your responsibility to determine which function you want to call from each of your web pages.
Note: If Strict Mode is enabled but you DO NOT select any countries for your Restricted Country List, Eloqua
WILL NOT TRACK any visitor to pages that call the Require Opt-in for visitors by Country function. In this
case we are assuming that you neglected to add countries to the list and have decided not to track anyone until
you add at least one country to the list. At that time, we will then only restrict tracking to those countries you've
added to the list. This also affects tracking redirect links in the same way (i.e. links from Emails and Landing
Pages).
17 / 22
banner at the top of the page to new visitors coming from restricted countries. For visitors who have opted-into
tracking, the banner will not be displayed and page view will be tracked:
<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', 'siteId']);
_elqQ.push(['elqTrackPageViewDisplayOptInBannerByCountry']);
(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);
})();
function elqVisitorTrackingOptIn() {
_elqQ.push(['elqOptIn']);
}
function elqVisitorTrackingOptOut() {
_elqQ.push(['elqOptOut']);
}
</script>
The styling and text of the Opt-in banner can be customized.
18 / 22
</script>
The following code does the same thing as the above snippet, except that it shows a simple default opt-in banner
at the top of the page to new visitors. For visitors who have opted-in to tracking, the banner will not be displayed
and page view will be tracked:
<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', 'siteId']);
_elqQ.push(['elqTrackPageViewDisplayOptInBannerForAll']);
(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);
})();
function elqVisitorTrackingOptIn() {
_elqQ.push(['elqOptIn']);
}
function elqVisitorTrackingOptOut() {
_elqQ.push(['elqOptOut']);
}
</script>
The styling and text of the Opt-in banner can be customized.
19 / 22
20 / 22
Opting-In/Out
The Eloqua tracking scripts allow users to opt-out of tracking at the site level as well as globally for all domains.
See Samples\OptStatus.html for a sample which illustrates how to show the user their current tracking status, and
allow them to opt-out/in. Opting-out at the site level involves creating a new cookie called ELQOPTOUT and
setting a value to indicate that for this particular site, the visitor should not be tracked in the Eloqua system. The
user's GUID is not removed and so if they later choose to opt back in, they will resume tracking against the same
visitor record. Opting-out at the global level removes their GUID from the cookie and thus makes them invisible to
our servers. If they opt back in, they will get a new GUID and will be tracked as a new visitor.
Note: The opt-in / opt-outs for first- and third-party cookie tracking are independent of each other. For example, if
a site is using first-party cookie tracking and a site visitor has both a first-party cookie opt-in and a third-party
cookie opt-out, only the first-party cookie opt-in will be used and the visitor will be tracked. This is an edge case
that is relevant primarily when you are transitioning a domain from third-party to first-party cookie tracking as part
of the beta program and a single visitor has both a third- and a first-party cookie.
The following code snippet returns visitor opt-in status for first-party cookie tracking. It returns 1 if the visitor is
opted in and 0 if the visitor is opted out. If the visitor is neither opted in nor opted out, an empty string is
returned.
function elqGetOptInCookieValue() {
var name, index, cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
index = cookies[i].indexOf('=');
if (index > 0 && cookies[i].length > index + 1) {
name = cookies[i].substr(0, index).trim();
if (name == 'OPTIN') {
return cookies[i].substr(index + 1);
}
}
}
return '';
}
21 / 22