Integrating forms

Forms are the way to get in touch with a company via the web. And we’re not just talking about contact forms. Forms are used to process orders, request brochures or white papers, manage event registrations, newsletter subscriptions, competitions, polls, etc.

Spotler offers the marketing professional a user-friendly drag & drop editor you can use to create smart forms and surveys in no time at all. With this editor you don’t need any technical know-how to use advanced features such as prefilling fields using contact data, personalization, conditional questions (branching), multi-paging, Thank You messages, form transcripts, the “Event Planner”, auto-response mails, separate webpagess, and much more.

Integration options

There are three integration options for Spotler forms and surveys. Before we delve deeper into the integration options the API offers, let us briefly review all three possibilities:

  1. Inserting a piece of javascript code form Spotler
    You can copy a piece of Javascript code from Spotler for each form included in a Spotler account and paste it into (the HTML of) your CMS system’s page. This script ensures that the form is retrieved from Spotler the moment a visitor opens the page. The validation-javascripts will also be included.
  2. Inserting HTML from Spotler
    The second option is to copy and paste the HTML of a Spotler form to a page in your CMS system. The validation-javascripts will also be included.
  3. Integrating forms via the API
    The third, and most elegant option is to use the API. Your CMS system can retrieve and display Spotler forms via the API when the visitor lands on the page. This option has a number of advantages over the previous two integration options. You can make full use of the features offered by the Spotler forms, such as server-side validation, conditional questions (branching), and multi-paging. In addition, and unlike the previous two options, you will not have to retrieve HTML or Javascript manually from Spotler.

schema-formulieren_Spotler.gif 

Retrieving available forms

When integrating web forms via the API, it is convenient to display a list of the available forms in the CMS. This way, the website administrator can easily insert a form on a page. The retrieved forms could, for instance, be presented to the administrator in a pulldown menu in the CMS backend.

redirect technical information Technical documentation
Get all forms

 

Retrieving a form

The CMS can use a method to retrieve (the HTML and scripts of) a Spotler form the moment a visitor accesses the page via the website.

When retrieving a form it is necessary to include where the form should be POSTed to (the “ACTION” attribute of the <FORM> tag). This is because the CMS itself must record the form submit. In addition, you can also indicate in which format you wish to retrieve the form (HTML or XHTML, and tables or divs). The API will return the HTML and scripts in the response.

redirect technical information Technical documentation
Get a form

 

Retrieving prefilled forms

If the CMS already contains the customer’s data, you can use this data to prefill forms for this customer. The CMS can use a method to retrieve (the HTML and scripts of) a prefilled Spotler form the moment a visitor accesses the page. In the call, the CMS should mention the values that need to be prefilled.

When retrieving a prefilled form it is also necessary to include where the form should be POSTed to (the “ACTION” attribute of the <FORM> tag). In addition, you can also indicate in which format you wish to retrieve the form (HTML or XHTML, and tables or divs). The API will return the HTML and scripts in the response.

redirect technical information Technical documentation
Get a prefilled form

 

Saving a form

When a respondent has filled out a form, the CMS will communicate the entered values to Spotler. This way, the values entered on the form can be saved in Spotler. The entered values are only communicated to Spotler once the CMS has recorded these values.

A Spotler form can also consist of multiple pages. In this case, the CMS must pass on the entered values when the visitor jumps to the next page (or back to the previous page).

The API gives the HTML of the next page (or the previous one), the Thank You page, or the current page (in case of an error) as the response. The response will show whether the form has been completed, so that the CMS can decide what is to be done with it. If an external Thank You page is displayed instead of a Spotler Thank You page, the API will not give the HTML of the next, previous, or Thank You page.

redirect technical information Technical documentation
Save a form (page)

 

Retrieving form response

It is also possible to retrieve all the response generated by a form in order to compile a report or to create follow-up campaigns. This process is described in the section Retrieving reports.

Standard plugin for WordPress

If you are using WordPress as your CMS, you will not have to develop your own plugin to integrate Spotler forms and surveys. Spotler has already developed this plugin for you. Using our plugin, you can place forms on pages and in posts in WordPress. Even if you are using a different CMS, the WordPress plugin may still be of interest to you, because you can use the PHP-code as a code template. You can download this free plugin at wordpress.org.