---
title: Connect for Eloqua
slug: cms-12/docs/connect-for-eloqua
docTags: 
createdAt: 2026-08-10T15:56:01.000Z
---

## Prerequisites

An Optimizely Content Management System (CMS) installation with Optimizely Forms and the required Marketing Automation connector components. See [Optimizely Connect for Marketing Automation](docId\:ts_gDosy9QODH5DQ8lldE).

## Install

The **Connect for Eloqua MA connector** is installed through the NuGet package [EPiServer.MarketingAutomationIntegration.Eloqua](http://nuget.episerver.com/en/OtherPages/Package/?packageId=EPiServer.MarketingAutomationIntegration.Eloqua). See [Add-ons platform compatibility](docId\:qlMSwdEfyS4CJlGWdudqk) for supported Optimizely versions.

## Configure

To configure your Optimizely website to use Eloqua, you need an Eloqua license that provides you with a username, password, and company name. You also must configure the connection of form fields to Eloqua so that data from the specified fields can be sent to Eloqua.

These configurations are described in [Eloqua connector](docId:79qH_KzfkVSAV7hGUhqGO) in the Optimizely User Guide.

## Encrypt credentials

Credentials are encrypted and saved based on one of the following options:

- `MAICryptoKey` – AES encryption with a SHA256-computer hash based on the value of the key.
  This key should be specified at the root level of the `appsettings.json` file with any string as its value.
- `machineKey` of the server.
  The `machineKey` encryption is used ONLY if `MAICryptoKey` is not specified. If you neglect to specify an `MAICryptoKey` in `appsettings.json`, the credentials are removed when the DXP instance is restarted
  because the `machineKey` is different and will fail to decrypt the credentials, so you must save credentials again through the configuration screen.

If the credentials are already encrypted using `machineKey` in an existing site, and the `MAICryptoKey` setting is added, then the credentials are deleted and must be re-entered.

:::hint{type="info"}
**Note**
The `MAICryptoKey` must be specified with the same value in ALL the DXP instances that are connected to the same database. If it is missing or the value is different in any of the instances, the credentials will be deleted and must be re-entered.
:::

## Submit form data to an Eloqua form

You can submit data from the Optimizely Form to a form in Eloqua. This provides extra features like analytics, user activity on the site, and data regarding which form created which contact.

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

See also the documentation video: [Personalization with Eloqua](https://optimizely.wistia.com/embed/iframe/rwoebpuiim?videoFoam=true)

To get the added functionality, perform the following steps.

1. Create a form in Eloqua; see [Creating forms](http://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAA/Help/Forms/Tasks/CreatingForms.htm) from the Oracle website.
2. Select **Change Contact's Email Address** and set it up as follows.
   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/iI-01jqc9M31BOeoGv15V-20260722-184805.png "eloqua-1.png")
3. Select **Update Contacts - With Form Data** and set it up as follows:
   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Oz_Uj_lW-yhSNh-7LegHm-20260722-184805.png "eloqua-2.png")
4. Create a form with the same fields as the Eloqua form created in step# 1. Map these fields to the appropriate fields in the field mapping drop-down list.
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 list as shown.
   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/C5IPTIwqN3OJalCAkcl0h-20260722-184805.png "eloqua-5.png")
   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/eY72KZ_89ILBek3inx6d1-20260722-184805.png "eloqua-6.png")
   The hidden field should look like the following image:
   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/wSH2eOvJoW5FwV7pRaY8H-20260722-184805.png "eloqua-9a.png")

:::hint{type="info"}
**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.
![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/EdGd3RQzVEHujFUTt2BEQ-20260722-184805.png "eloqua-10.png")
:::

:::hint{type="info"}
**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](https://docs.oracle.com/en/cloud/saas/marketing/eloqua-user/Help/Forms/Tasks/CapturingSubmissionDataFromAnExternalForm.htm) 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 and scripts or add them directly to the template that renders the form. See [Reposting externally hosted forms](https://docs.oracle.com/en/cloud/saas/marketing/eloqua-user/Help/EloquaAsynchronousTrackingScripts/Tasks/RepostingExternalForms.htm) on the Oracle website.

```xml
<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](https://docs.oracle.com/en/cloud/saas/marketing/eloqua-user/Help/EloquaAsynchronousTrackingScripts/Tasks/TrackingCustomURLs.htm)on the Oracle website.
   - Script 1

```javascript
<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

```javascript
<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 records the Eloqua form's submission.
