Eloqua: Post data to Elq web form

This document walks you through how to set up a "post to web form" integration and optionally implement Eloqua visitor tracking and GUID scripts.

Ion can reliably post data to existing web forms published in Eloqua’s marketing automation platform. Once integrated, your ion experiences will seamlessly post the data you define to your Eloqua form(s). 

Before we begin

There are a few items you'll need to roundup from Eloqua before beginning, listed below:

  • Eloqua-supplied Basic Page View Tracking script
  • Eloqua endpoint URL and field names
  • Eloqua Site ID and form name(s)


The Eloqua form HTML contains your Site ID, endpoint URL and field names.

There are a few steps to take in ion before you begin listed below:

  • Create data collection fields
  • Create data collection fields for Eloqua hidden fields, using the following data names:
    • elqSiteId
    • elqFormName
    • elqCustomerGUID
    • elqCookieWrite
  • Create ion form(s)
  • Set-up testing creative 

Let's get started!

1. Create field mapping

Taking the steps below will create a field map between your ion data collection fields to their corresponding Eloqua field names.

  1. Click the Integrations tab in your console’s side nav
  2. Click the green “New field mapping” button
  3. Label the field mapping and optionally add a description
  4. From the Integration type menu, select “Post to Web Form”
  5. Save

2. Add Outbound fields

Outbound fields define the data you extend from ion to your external web form. Refer to your Eloqua form HTML for the proper external field names. Be sure to add your Eloqua hidden fields, using the values from the Eloqua form as the default value for the Outbound field. Please note, elqCustomerGUID will not have a default value. If you are posting to multiple Eloqua forms, you can save the the elqFormName value via an ion form rule. We'll cover how to do this later in the document.

  1. Click the green “New outbound field” button to add a new field to your field mapping
  2. When adding a new field, you will either select from the Data Collection drop-down menus, Core Field drop-down menu, implement a mashup template or add a field via JavaScript
    • To add a form field, use the Data Collection drop-down menus to select the data field category then data collection field
    • OR, to add an ion Core field, select from the Core Field drop-down menu
    • OR, to export multiple ion fields to one external field, use the Mashup Field by plugging {{DataName}} {{DataName2}} , etc. into the editor
    • OR, to reformat a value prior to export, use the JavaScript field to add logic around the value collected in ion. To access data collection fields via Javascript, use respondent.dataname.
  3. Optionally make your field required to run the integration
  4. Optionally add a default value
  5. Enter the external field name
  6. Save
  7. Repeat these steps for each field that should be included in the Field Mapping

3. Create Integration

  1. Navigate back to the Integrations screen
  2. Click into the Integrations tab
  3. Click the green “New integration” button
  4. Enter label
  5. Optionally add a description
  6. Select the Field Mapping you’ve just created
  7. Paste the Eloqua Form URL into the editor
    • This is the “post to” or end point URL of your web form.
  8. Set maximum retries
    • If there is a service interruption with the external platform, Ion will retry the post on the top of the hour for as many retries as you indicate here.
  9. Select POST as the method
  10. Optionally add Debug email address
    • Email addresses specified here will receive an email each time the integration runs that displays the data posted and response received. This is feature typically only used for testing and troubleshooting.
  11. Save

4. Add integration to your Ion pages

The ion platform runs the integration based on rules you create. Rules can be added to any actionable item in your ion creative. Integration rules are typically run at the form-level, upon form submission, or on an assessment step. Follow the steps below to add the integration to your ion pages.

  1. Navigate into the creative
  2. Click on the form submit button or link you seek to make the trigger to run your integration
  3. In Creative Studio, click on +rules
  4. Select the condition that needs to be met to run the integration
    • “No conditions required” is typically used
  5. Select “Run integration” as the action
  6. Save
  7. Repeat for each applicable creative

5. When posting to multiple Eloqua forms...

If you seek to post data to multiple Eloqua forms, you can save the elqFormName value via a form-level rule. The value you save here will overwrite the default value in the export format. This rule action needs to be implemented above the rule to run the integration.
 

Condition: No conditions required

Action: Save into database - elqFormName = value

6. Optionally implement Eloqua visitor tracking script

Eloqua provides visitor tracking script that can be implemented on your ion experiences. The Basic Page View tracking script can be found in the Eloqua Asynchronous Visitor Tracking Scripts document and a sample is included below. Replace 'SiteId' on line three with your Eloqua SiteId.
 

a. Store Eloqua script Ion Libraries

  1. In ion, navigate to the Libraries menu and select Scripts
  2. Add a new category labeled "Eloqua" or navigate into an existing category
  3. Click green “New script” button
  4. Use "Campaign - Head" as the label
  5. Paste the script into the editor


b. Add Eloqua script to ion Campaigns

  1. Navigate to your Campaign Management screen
  2. Click into the Actions dropdown menu and select “Edit campaign”
  3. Select  Eloqua > Campaign - Head script from the head tag drop-down menus
  4. Save
  5. Repeat for each applicable Campaign


c. Sample Eloqua Vistor Tracking Script:

<script type="text/javascript">

var _elqQ = _elqQ || [];

_elqQ.push(['elqSetSiteId', 'siteId']);

_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>

7. Optionally add script to save elqCustomerGUID into data collection

You'll add one more code block to your ion form pages in order to save the Eloqua GUID value and store it in an ion data collection field. This enables you to include the GUID in your post to the Eloqua form.
 

a. Create ion data collection field to save GUID value

  1. Navigate to Data Management > Data Collection
  2. Navigate into an existing category or create a new data field category
  3. Add a new data field with a data name of elqCustomerGUID
  4. Save


b. Store GUID script in ion Libraries

  1. In ion, navigate to the Libraries menu and select Scripts
  2. Add a new category labeled "Eloqua" or navigate into an existing category
  3. Click green “New script” button and use "Form page - Body" as the label
  4. Paste the script into the editor


c. Add GUID script to form pages

  1. Navigate into your ion creative's form page
  2. Click +scripts from the Page tab in your creative studio
  3. Select Eloqua > Form page - Body from the closing body tag drop-down menus
  4. Save
  5. Repeat for each applicable form page


d. Example script to save GUID:

<script type="text/javascript">

var timerId = null, timeout = 5;

function WaitUntilCustomerGUIDIsRetrieved() {

if (!!(timerId)) {

if (timeout == 0) {

return;

}

if (typeof this.GetElqCustomerGUID === 'function') {

var elq_GUID = GetElqCustomerGUID();

liveballData("elqCustomerGUID", elq_GUID);

return;

}

timeout -= 1;

}

timerId = setTimeout("WaitUntilCustomerGUIDIsRetrieved()", 500);

return;

}

window.onload = WaitUntilCustomerGUIDIsRetrieved;

_elqQ.push(['elqGetCustomerGUID']);

</script>

8. Test integration

To test your integration, use the testing creative you set up prior to beginning the integration steps. Please note, integrations do not run in Preview Mode so you'll want to open a URL for testing. The integration will run once you submit the ion form, or complete the action that runs the integration rule. If you’re on the debug email distribution list, you’ll receive an email that displays the data posted and response from the external server. You’ll also want to check that the data you submitted was received by and processed properly by Eloqua.

Nice work!

Once you’ve completed these steps, your integration is ready for use. You can add the rule to run the integration on all applicable creatives. 


If you have any questions, please contact us at help@rockcontent.com. 😀