Discussions

How to repost an externally hosted form to Eloqua

Thomas Reyto-Oracle
Thomas Reyto-Oracle Posts: 9 Employee
edited Apr 29, 2022 6:21AM in Eloqua

Follow these steps for externally hosted forms where the form data is re-posted to Eloqua servers from a server-side form processor. In this case it's not possible to get the cookie from the client's machine so the following instructions provide the necessary code to place on the form page to send the unique ID along with the form data to Eloqua. This ensures that the visitor submitting the form is linked to the Eloqua contact record so you can capture and track their digital body language.

Notes:

  • Recommendation – Create a copy of the externally hosted form you will integrate with and create a test page to get functionality in place and tested before it goes to production.
  • You will notice that there is a Form Integration Wizard in Eloqua.  The scripts provided in this Wizard currently need to be updated, so please use the instructions below until they have been updated.  Theoretically, you could use the Form Integration Wizard to build your Eloqua Form… but you will still want to use the scripts and QA process below to implement.
  • This applies if you are using the asynchronous web tracking scripts generated after Dec 11, 2011.

Step 1: Build the back-end Eloqua Form.

  1. Create New Form
  2. Turn pre-population off
  3. Create Fields that mirror fields on web form
  4. Set the HTML name (go to gear box, settings – ‘generate; use; save’)
  5. For each form field, set the HTML field name (Field Settings; Advanced Settings).  To retrieve HTML field name, you can ‘view source’ of web page where form is hosted, or request from web resource.

Step 2:

Provide the following instructions to the person making the updates on the webpage. You will need to update the ‘elqFormName’ value with each form (this is the unique Eloqua Form ID), the ‘elqSiteID’ will remain constant (this is your instance of Eloqua).  To retrieve the ‘elqFormName’ and ‘elqSiteID’ go to the Eloqua Form, click the gear box, select ‘View Form HTML’ and select ‘Integration Details’.  You will see that you need to plug the ‘elqFormName’ value in twice below.

     a) Post URL for the form: action= s<siteid>.t.eloqua.com/e/f2 (supports both http and https posts)

     b) Add the following on the initial HTML page within the <Form> tag (no specific location needed so long as they are included as hidden fields on the initial HTML form page and are posted upon the initial post):

<input type="hidden" name="elqFormName" value="ENTER ELOQUA HTML FORM NAME" />

<input type="hidden" name="elqSiteId" value="ENTER SITE ID" />

<input type="hidden" name="elqCustomerGUID" value="">

<input type="hidden" name="elqCookieWrite" value="0">

     c) Then, place the following code anywhere after the main tracking scripts appear on the page:

var timerId = null, timeout = 5;

function WaitUntilCustomerGUIDIsRetrieved() {

if (!!(timerId)) {

if (timeout == 0) {

return;

}

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

               document.forms["ENTER ELOQUA HTML FORM NAME"].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 "ENTER ELOQUA HTML FORM NAME" with the actual html form name as setup in the Eloqua application.

Step 3: Testing and Verification

Once you submit the form, the first place to check is ‘View Submission Data’. On the Eloqua Form, click the Gear Box, and go to ‘View Submission Data’.

Verify that the form was posted and that each field was received by Eloqua.

screenshot1.png


The next step is to verify that your Form Processing Steps are working as expected.

Wait ~20 minutes and check the Contact to confirm the Form Activity is logged on the Contact Record.

Step 4:

Once your QA is complete, ask your IT resource to apply the scripts to the ‘live page’ and re-run QA.

These instructions apply to both Eloqua9 and Eloqua10 and to all product levels (Express, Team, Enterprise), although the specific navigation and screenshots provided are specific to Eloqua10.

Post edited by OIT Integration User on
Tagged:
«1

Comments

  • robinwu
    robinwu Posts: 8 Blue Ribbon

    Hi Thomas,

    I'm fairly new to the forms. Could you clarify/give example of when a form would be re-posted from another location? I don't quite understand when I should be using this. I recently created a form that was hosted on my company's website. In the Form Integration Details window (E10), I only gave my web producer the "Post URL for this form:" and "Required hidden fields for this form:" data. Is this correct?

    There are 2 other fields in the bottom of the window ("Required tracking script HTML for this form" and "Required hidden tracking fields for this form") -- when would I need to use this code?

    Thanks,

    Robin

  • Hi Thomas,

    I'm fairly new to the forms. Could you clarify/give example of when a form would be re-posted from another location? I don't quite understand when I should be using this. I recently created a form that was hosted on my company's website. In the Form Integration Details window (E10), I only gave my web producer the "Post URL for this form:" and "Required hidden fields for this form:" data. Is this correct?

    There are 2 other fields in the bottom of the window ("Required tracking script HTML for this form" and "Required hidden tracking fields for this form") -- when would I need to use this code?

    Thanks,

    Robin

    Hi Robin.

    When a form is hosted on your website, they can typically be posted directly to Eloqua and if needed we can push the data back out to your system for your records.   A re-post scenario is used when you have servers that need to do processing first.  i.e. Generate a text trial download key and send in the email, or create an account in your CMS, or capture payment and strip out credit card and payment info before passing it to Eloqua.  I hope that helps.

    Cheers, Aaron.

  • robinwu
    robinwu Posts: 8 Blue Ribbon

    Thanks Aaron! That makes sense.

  • 2874099
    2874099 Posts: 1 Green Ribbon

    Thanks Aaron! That makes sense.

    Can any body let me know where to create form? Do i need to install any tool? Please explain.

  • Can any body let me know where to create form? Do i need to install any tool? Please explain.

    Hi - you create forms and landing pages from the "Assets" area in Eloqua.

  • martina01
    martina01 Posts: 3 Bronze Medal

    Hi, I'm unclear about something:

    Does the Eloqua tracking script also need to be present on the page that the external form is hosted on, apart from the steps as described above?

    Thanks and Regards,

    Martina

  • Hi Martina,

    Yes, the Eloqua tracking scripts need to be on the page.

    Thanks,

    Thomas

  • We are getting all the data to pass through the form, but we are having an issue with the GUID.  Do we need to pass the GUID into a hidden field on the form?  Or where are we posting the GUID to?

  • Hi Mark, if this is a server side post then the JS in the instructions gets the GUID, sets the hidden field, then passes the GUID to Eloqua in your server side post.  If this is a direct post to Eloqua, no need for JS. Hope this helps.

  • Mike McKinnon
    Mike McKinnon Posts: 7 Gold Trophy

    Hi Thomas,

    Thanks for the post. We do some reposting on one of our free trial pages here: Try | ReadyTalk. I had some specific questions about the code in Step 2c. As I do not see that code on our page.The closest I see is this:

    if (this.GetElqCustomerGUID){

    document.forms["signup_form"].elements["elqCustomerGUID"].value = GetElqCustomerGUID();



    I assume this code is waiting for the GUID to be created (if the record does not exist) and then passing that back to Eloqua so the submitter can be properly cookied? Is this correct?

    Further, we use curl to post back to the form URL in the processing script here <form action="/rt/signup_process.php>. The processing script packages up the form submit and then reposts back to the form URL using curl :

    curl_setopt($ch, CURLOPT_URL, "https://secure.eloqua.com/e/f2.aspx elqFormName=FreeTrialForm&elqSiteID=1904");


    What is the difference in the way we have it set up as opposed to how you outline it above? I am just trying to get a better grasp on what our web developer did with our re-post.


    Thanks for your help.


  • Christopher Campbell-Oracle
    Christopher Campbell-Oracle Director, Product Management Posts: 20 Employee

    Hi Mike,

    The line document.forms["signup_form"].elements["elqCustomerGUID"].value = GetElqCustomerGUID(); populates the form field elqCustomerGUID with the visitor's GUID value.  This is necessary to track activities when using a server side post (form data is submitted to your server first, the server then posts the data to Eloqua).

    Additionally, when using a server side post, cURL is a common tool used to perform the server side post.  A direct post to Eloqua is possible by changing the form action URL to https://secure.eloqua.com/e/f2.  One major difference between the two methods is who controls the visitor experience (web page redirect) after the form submit.  When posting directly to Eloqua, Eloqua controls the visitor experience.  With a server side post, the server controls the visitor experience.

    Hope this helps!

    Chris

  • mlavdas
    mlavdas Posts: 2 Bronze Medal

    Thomas,

    Quick question, would this cover also the creation of new contacts in Eloqua? or will it only track the behavior of existing contacts?

    If not, do you know how this can be created?

    Thanks a lot!!

    Melissa

  • Hi Melissa,

    Yes - if a person submits the form and is not already an Eloqua Record (based on email address), a new record will be created for the person submitting the form.  The key here is that the form processing step (Update Contacts - With Form Data) must be included on the Eloqua form.

    Hope this helps.


    Thomas

  • mlavdas
    mlavdas Posts: 2 Bronze Medal

    Hi Melissa,

    Yes - if a person submits the form and is not already an Eloqua Record (based on email address), a new record will be created for the person submitting the form.  The key here is that the form processing step (Update Contacts - With Form Data) must be included on the Eloqua form.

    Hope this helps.


    Thomas

    Perfect! Thanks a lot for your fast response Thomas!

  • 2870320
    2870320 Posts: 2 Silver Medal

    I'm having trouble coordinating the input names in my Eloqua form to those of the hosted form. Eloqua is only allowing max 50 characters for the HTML name and our hosted form names are longer than 50.

    Has anyone else encountered a similar problem? I suppose I could ask our web team to modify the names on the form, but I don't know if they'll support that. Is there any way to go beyond 50 characters?

  • I'm having trouble coordinating the input names in my Eloqua form to those of the hosted form. Eloqua is only allowing max 50 characters for the HTML name and our hosted form names are longer than 50.

    Has anyone else encountered a similar problem? I suppose I could ask our web team to modify the names on the form, but I don't know if they'll support that. Is there any way to go beyond 50 characters?

    Hi Hannah!

    I've seen this stuations when a website is on an ASP.NET framework. ASP.NET uses the form inputs' "name" attributes internally, which doesn allow for control over what is rendered. You can shorten up the form inputs' "id" attributes, but the names can't be altered. But, there IS a way to get around this and still integrate your forms with Eloqua by integrating the forms via a web form repost. Instead of creating the form in Eloqua via the Integration Wizard, you'll want to create a form from scratch. Generate the form html name, as well as the form field html names. Provide that info to your web resource, as the form and field names MUST match for to perform a form repost. This should get you around the 50 character limitation on html form field names


    Hope this helps!

  • 2870320
    2870320 Posts: 2 Silver Medal

    Hi Hannah!

    I've seen this stuations when a website is on an ASP.NET framework. ASP.NET uses the form inputs' "name" attributes internally, which doesn allow for control over what is rendered. You can shorten up the form inputs' "id" attributes, but the names can't be altered. But, there IS a way to get around this and still integrate your forms with Eloqua by integrating the forms via a web form repost. Instead of creating the form in Eloqua via the Integration Wizard, you'll want to create a form from scratch. Generate the form html name, as well as the form field html names. Provide that info to your web resource, as the form and field names MUST match for to perform a form repost. This should get you around the 50 character limitation on html form field names


    Hope this helps!

    Thanks, Leigh. I think we'll have to do that. Appreciate your quick response

  • Hi Thomas,

    I'm a little confused, in that this content doesn't seem to include any information about reposting a form.  Maybe a title like "Setting up to enable reposting" or something would have been clearer?  I'm just getting started this minute, so I'm hoping the actual example of reporting are on the "Code It" section of the site, although I'm guessing that if its a standard form POST to do server-side then it shouldn't be too hard to get working.

  • Thanks Thomas!  This is very helpful!

  • nader.shahin
    nader.shahin Posts: 2 Red Ribbon

    Thanks nice post.

  • Thank you.  This is very helpful. 

  • Right now if you post that action item then it will take you off of the page and send to an Eloqua page. I am setting up a form when users sign up for our website. So when they hit submit I need for them to stay on our website/server but have the information just posted to Eloqua. Any ideas?

  • Right now if you post that action item then it will take you off of the page and send to an Eloqua page. I am setting up a form when users sign up for our website. So when they hit submit I need for them to stay on our website/server but have the information just posted to Eloqua. Any ideas?

    Do you have a step in your processing steps on your Eloqua form to redirect to webpage?  If so delete that step out and try again.  :-) Let me know if that doesn't work.

  • Do you have a step in your processing steps on your Eloqua form to redirect to webpage?  If so delete that step out and try again.  :-) Let me know if that doesn't work.

    The only processing I have in the form processing step is to update the contact information. The Action step that is supposed to be placed on the website is where I am having issues. It is taking the end user off our website and taking them to an Eloqua page which is what we are trying to avoid.

  • aziznana786
    aziznana786 Posts: 12 Bronze Trophy
    edited Aug 13, 2013 3:27PM

    It seems that I am getting my form activity into Eloqua, however, I am not getting any web activity tracked. Please check this Test page - we have the script in etc, however I am unsure why I am not getting any activity for that specific contact.

    The website has workign tracking scripts which is capturing visits from existing contacts. Need some help on this!

    Thank you,

    Aziz Nana

    Post edited by Unknown User on
  • It seems that I am getting my form activity into Eloqua, however, I am not getting any web activity tracked. Please check this Test page - we have the script in etc, however I am unsure why I am not getting any activity for that specific contact.

    The website has workign tracking scripts which is capturing visits from existing contacts. Need some help on this!

    Thank you,

    Aziz Nana

    Hi Abdulaziz, please contact Eloqua Support by logging an issue or calling in.  They will be able to look behind the scenes and isolate the issue. Are you noticing this for real records, or only with test records you are working with?  Thanks!

  • aziznana786
    aziznana786 Posts: 12 Bronze Trophy

    Thomas,

    I am only working with test records.

    One question I have is, does the JS script have to be after the Eloqua tracking script? or will it work if the script is before the Trackgin script?

  • Hi Abdulaziz,

    The JS must be after the Eloqua Tracking Script.

    Also, I suspect that your experience of not seeing activities for your test records is due to cookie confusion. I have run into this before when testing with multiple Eloqua Contact Records.  You will likely find that all activities are currently associating to one of your Test Records.  Support is able to look behind the scenes here to help clarify what you are seeing.

    Thanks!

  • aziznana786
    aziznana786 Posts: 12 Bronze Trophy

    Hi Abdulaziz,

    The JS must be after the Eloqua Tracking Script.

    Also, I suspect that your experience of not seeing activities for your test records is due to cookie confusion. I have run into this before when testing with multiple Eloqua Contact Records.  You will likely find that all activities are currently associating to one of your Test Records.  Support is able to look behind the scenes here to help clarify what you are seeing.

    Thanks!

    Hi Thomas,

    Thanks! I figured as much - for whatever reason, the Drupal Module is putting it before.

    With regards to the cookie confusion - I don't believe so, yesterday I was on a completely different computer (one I've never used) and I always clear everything before new tests i.e. cookies, cache and completely everything.

    Thanks!

  • Hi Thomas,

    Could you please explain where the method:

    GetElqCustomerGUID()


    is defined?


    If I am including the javascript above in an external web form I created, I do not understand how it could call this method if it is not obtained via an import or defined in our page.


    Thanks,

    Jad