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 several integration options for Spotler forms and surveys. Don't use the Rest-Api for integrating forms. Then read the article: Exporting and integrating forms.

The best way to integrate a form is by using the API. Your CMS system can retrieve forms from Spotler via the API and display them the moment the visitor lands on the page. This has a number of advantages over the other integration options (exporting code and placing it on your website or on a Spotler web page). You can fully utilize the functionalities of the Spotler forms, such as server-side validation, conditional questions (branching) and multi-page forms. In addition, unlike the other two integration options, you no longer have to manually retrieve HTML or Javascript 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.

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.

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.

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.

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.