Support Center

purlHub FORMs (pre-populate & capture)

Last Updated: Dec 17, 2012 06:13PM MST

Nearly all personalized marketing strategies involve a call-to-action that requires some type of online user submission.  Either checking "YES", clicking "CALL" or submitting a FORM, purlHub has been built from the ground up to both support it and track it.  In the case of personalized marketing strategies that include a call-to-action FORM on the landing page, purlHub automatically fills in the form with personalized data (form pre-populate).

PurlHub provides an unobtrusive manner of integrating with HTML FORMs on a landing page, tracking the event, capturing the data and associating that data with the personalized visitors id (purlCode).  We call these types of submissions "records", and purlHub supports an arbitrary number of them, identified by name.  In addition, purlHub provides easy access to view, export and analyze these "records" - via the purlhub account portal.

There are 2 steps to integrating a form with the purlHub JSAPI.

  1. Identify the FORM to integrate (defining the type and name to use).
  2. Flag the fields to integrate (capture and pre-populate).

Identifying the FORM as a purlHub record: 

Either set the FORM's ID to the default record identifier prefix, "phRecordForm", or define your own via the purlService config option "recordFormIdPrefix" and set the FORM's ID to your own prefix.  Then define a "Record Name" to store the form as.  The simplest approach is to set the FORM's NAME attribute.  Alternately, append a suffix to the FORM's ID attribute separated by a hyphen or an underscore (e.g. id="phRecordForm-requestInfo").  Keep in mind, if you use both methods, the FORM's NAME takes precedence in defining the "Record Name" used. 

<form id="phRecordForm-requestInfo" method="post">
<form id="phRecordForm" name="requestInfo" method="post">

This sets up the FORM to be automatically captured by purlHub when the FORM is  submitted.  No interference with the FORM's "action", or any events bound to the FORM is required.  And you're free to use the FORM's action attribute as normal.  purlHub will intercept the submission, capture the data, and allow the form to continue.

Flagging FORM inputs: 

Next, you must mark what FORM input fields (at least 1) to pre-populate and capture by following the purlHub common Class Flag syntax.

Profiles: {profilePrefix}-{propertyName}
Records: {recordPrefix}-{recordName}-{propertyName}
Attributes: {attributePrefix}-{attributeName} 

Within a FORM INPUT tag, the Class Flag's "propertyName" component sets the property within the record to set as the initial value AND defines the property name within the record to store the value as.  Alternately,  you can use a short form of the Class Flag in conjunction with the field's NAME attribute.  Keep in mind, the "propertyName" suffix always takes precedence when identifying the property name, in cases  where both a NAME attribute and a long Class Flag are used. The following examples flag the "firstName" input field for data capture and pre-populate.

<input type="text" name="firstName" class="phRecordData-requestInfo" />
<input type="text" name="name" class="phRecordData-requestInfo-firstName" />

Repeat this method for each field that you want to integrate with purlHub, and your FORM is setup.  FORM's can easily be multi-purposed.  Capturing select fields in purlHub while at the same time submitting to SalesForce.com, Sugar CRM or your own form processor.

Contact Us

  • Post a Public Question
  • Ask the Community
  • Email Us

Recent Discussions