Support Center

AJAX Form Handling

Last Updated: Feb 05, 2016 10:18AM PST

To report customer conversion to Bizible manually, we have provided a VERY simple api that you can use.  Both of these Javascript APIs are automatically available in your site if you have our tracking code on it.  No need to do anything special to access them.


Scenario 1 – HTML form with an AJAX submit
When using forms using Ajax or another mechanism to submit date from the client to their servers, Bizible may not be aware of the customer conversion through any of the standard paths that Bizible does monitor.
In this scenario, we have provided a simple API to leverage.


If you handle your own form submission, then you can explicitly call Bizible from Javascript.  Bizible will collect all the relevant information from the form and post it asynchronously to our servers.


Below is a code sample not using JQuery (assuming the ID on the form is "formId"):


///////////////////////////////////////////////////////////////////////
// Preamble for all API usage.

window['Bizible'] = window['Bizible'] || { _queue: [], Push: function (o, p) {this._queue.push({ type: o, data: p }); } };

// Give Bizible the Form ID and we'll collect the data automatically.
Bizible.Push('Form','MyFormID');


Below is a code sample using JQuery (assuming the ID on the form is "formId"):

///////////////////////////////////////////////////////////////////////
// Preamble for all API usage.
window['Bizible'] = window['Bizible'] || { _queue: [], Push: function (o, p) {this._queue.push({ type: o, data: p }); } };


// Give Bizible the JQuery Selector for the form and we'll collect the data automatically.
Bizible.Push('Form',$('#formId'));


Scenario 2 – Lead information collected in a non-HTML form

If lead information is collected using Javascript or plain old text fields with no html form, this solution will work for you.
In this scenario, we have provided a simple API to leverage:


///////////////////////////////////////////////////////////////////////
// Preamble for all API usage.
window['Bizible'] = window['Bizible'] || { _queue: [], Push: function (o, p) {this._queue.push({ type: o, data: p }); } };


// If your site is using Ajax, or you are running a secure site, it is best to send us the data directly.
Bizible.Push('User', {

  eMail: 'user@gmail.com',   // required
  });



From this structure, only the email field is strictly required, all other fields are optional
Bizible will post this data asynchronously to our servers.


Scenario 3 - Report user information on the Thank You page
In some cases, it is more convenient to report the user information to Bizible on the thank-you page of a form submission.  In this case, the simplest way to report this user is by adding a hidden element to the page that contains the information, and Bizible.js will read this information when it is loaded.
For example:


<div id="bizible.reportUser" style="display:none"
data-email="user@gmail.com"
data-invoiceAmount="$0.05"/>



It does not matter whether this is a div, or a script, or any other tag type. We look for the id="bizible.reportUser".

Contact Us

  • (800) 913-2620
http://assets1.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete