Skip to content

Instantly share code, notes, and snippets.

@robertpateii
Created March 9, 2012 20:22
Show Gist options
  • Save robertpateii/2008480 to your computer and use it in GitHub Desktop.
Save robertpateii/2008480 to your computer and use it in GitHub Desktop.
This is my JavaScript for integrating the Regus "book a meeting room" form with LifeSize's marketing automation tool, Eloqua. There's nothing here you couldn't find on your own looking over the public html and js files.
// save_two() already exists. this should replace it, but currently validation happens *after* save_two() fires. this is a problem. my code assumes it's valid.
function save_two(){
var contactData = {name1: 'firstname', val1: $('#firstname').val(), name2: 'lastname', val2: $('#lastname').val(),name3: 'emailaddress', val3: $('#emailaddress').val(),name4: 'contactnumber', val4: $('#contactnumber').val(),name5: 'company', val5: $('#company').val(),name6: 'contact_country', val6: $('#contact_country').val()};
$.ajax({
url: "http://lifesize.regusonline.net/form_change_two.php",
type: "POST",
data: contactData,
async:false,
success: function(data){
}
});
// Lifesize Integration. Assumes fields have been validated.
// Test this in firefox. If a page load follows this function it may load the page before the post to Eloqua completes.
var elqQuery = "elqSiteID=381&elqFormName=regus_reservation&SFDCLastCampaignID=70130000001uEKE&00N30000000f3lX=Web: Regus_Reservation&lead_source=Web Direct&non_mdr_actionable=1&elqCookieWrite=0";
elqQuery += "&" + contactData.name1 + "=" + contactData.val1 + "&" + contactData.name2 + "=" + contactData.val2 + "&" + contactData.name3 + "=" + contactData.val3 + "&" + contactData.name4 + "=" + contactData.val4+ "&" + contactData.name5 + "=" + contactData.val5 + "&" + contactData.name6 + "=" + contactData.val6;
if (typeof GetElqCustomerGUID === 'function') {
elqQuery+= "&elqCustomerGUID=" + GetElqCustomerGUID();
}
$.getJSON("http://now.eloqua.com/e/f2.aspx?callback=?", elqQuery);
}
/* To get form submissions to show up on the visitor's contact profile, add this html to the bottom of the body element on the submission page.
<!-- Eloqua Tracking-->
<script type="text/javascript" language="javascript" src="/assets/elqCfg.js"></script>
<script type="text/javascript" language="javascript" src="/assets/elqImg.js"></script>
<!-- End Eloqua Tracking-->
<!-- Eloqua Form Tracking - getting Eloqua GUID -->
<script type="text/javascript" language="javascript">
var elqPPS = '70';
</script>
<script type="text/javascript" language="javascript" src="/assets/elqScr.js"></script>
<!-- Note: actual post to eloqua is in the save_two() function. -->
<!-- End Eloqua Tracking Scripts -->
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment