Loading...
Area: Optimizely Add-ons
Applies to versions: MarketingAutomationIntegration.Eloqua 1 and higher

Submitting Form data to an Eloqua form

Recommended reading 

This topic describes how to set up posting of form data to an Eloqua form, when using the Optimizely Connect for Eloqua MA connector with an Optimizely website. Posting to Eloqua form provides some extra features like analytics, user activity on the site, and form submission data like which form created which contact. Marketers can for example see which form is driving the most conversions.

How it works

Existing Optimizely Form functionality and this added functionality each send form data from Optimizely to Eloqua. The difference is that this feature also makes a post to an Eloqua form. 

To get the added functionality, perform the following steps. 

  1. Create a form in Eloqua; see Creating forms from the Oracle website.
  2. Select Change Contact's Email Address and set it up as follows.

    eloqua-1.png

  3. Select Update Contacts - With Form Data and set it up as follows:

    eloqua-2.png

  4. Create a form with the same set of fields as the Eloqua form created in step# 1. Map these fields to the appropriate fields in the field mapping drop-down.
  5. Add a pre-defined hidden field with the values to the form you created, and map it to elqFormUrl in the field mapping drop-down as shown.

    eloqua-5.png

    eloqua-6.png

    The hidden field should look like the following image:

    eloqua-9a.png

    Note: The value of the elqFormUrl hidden field should be only the URL displayed in quotes in the following picture; the “action=” part should be omitted.
    eloqua-10.png

    Note: Form integration details are in the Eloqua portal, where you create a form in Eloqua. This is where you get the value for elqFormUrl. For reference see, Capturing submission data from an external form on the Oracle website.

  6. Add the following hidden fields to the HTML of your forms page. You can use a custom block that  outputs raw HTML/scripts, or add them directly on the template which renders the form. See Reposting externally hosted forms on the Oracle website.
    <input type="hidden" name="elqFormName" value="YourEloquaFormName" />
    <input type="hidden" name="elqSiteId" value="YourSiteId" />
    <input type="hidden" name="elqCustomerGUID" value="">
    <input type="hidden" name="elqCookieWrite" value="0">
  7. Add the following scripts to the page.  See Tracking Custom URLS and referrers using JavaScript on the Oracle website.
    • Script 1
      <script type="text/javascript">
      var _elqQ = _elqQ || [];
      _elqQ.push(['elqSetSiteId', 'YourSiteId']);
      _elqQ.push(['elqTrackPageView']);
                                  
      (function () 
        {
          function async_load() 
            {
              var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true;
              s.src = '//img03.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>
    • Script 2
      <script type="text/javascript">
      var timerId = null, timeout = 5;
      function WaitUntilCustomerGUIDIsRetrieved() 
        {
          if (!!(timerId)) 
            {
              if (timeout == 0) 
                {
                  return;
                }
              if (typeof this.GetElqCustomerGUID === 'function') 
                {
                  document.getElementsByName("elqCustomerGUID")[0].value = GetElqCustomerGUID();
                  return;
                }
              timeout -= 1;
            }
          timerId = setTimeout("WaitUntilCustomerGUIDIsRetrieved()", 500);
          return;
        }
      window.onload = WaitUntilCustomerGUIDIsRetrieved;
      _elqQ.push(['elqGetCustomerGUID']);
      </script>

The form is ready. When you submit the Optimizely form, it creates a contact and also records the submission of the Eloqua form.

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Jun 07, 2019

Recommended reading