Overview:
What are webhooks?
Webhooks allow you to communicate with a software. You can let the software know that a certain event has occurred, and then trigger a response to that event. Looking at Perspective funnels, webhooks are particularly useful for transmitting contact information to other programs as soon as a lead is created (e.g. to your CRM, your email, or even systems like Integromat).
As soon as a new response is submitted to your funnel, Perspective forwards the incoming data to your webhook URL (POST). You can specify the target API endpoint using this integration.
You have the choice between 2 different triggers (actions that trigger the webhook):
1. New Lead
Webhook is triggered via POST requests as soon as a visitor to your funnel converts to a lead.
2. Funnel completed
Webhook is triggered via POST requests as soon as a visitor has completely passed through your funnel.
You can use up to 3 webhooks per trigger
Tutorial: Webhooks Integration
Body & POST data example
The so-called body or POST data is a JSON object with 4 properties.
Example of POST data:
Property | Type | Description |
id | String | The contact ID - this is the unique identifier |
funnelName | String | The name of the funnel |
meta | Object |
|
meta ⇒ createdAt | UTC Timestamp | Timestamp when the contact was first created or "first seen". |
meta ⇒ lastSeenAt | UTC Timestamp | Timestamp when the contact sent the last data. |
meta ⇒ completedAt | UTC Timestamp | Timestamp for when the contact reached the last page or any result page. |
meta ⇒ convertedAt | UTC Timestamp | Timestamp for when the contact submitted a form with a completed email or phone input field. |
meta ⇒ globalId | String | Identifier generated on the funnel and used when the contact visits multiple funnels on the same domain. |
meta ⇒ completed | Boolean | Flag that is toggled whether the contact has reached the last funnel page or any result page.
When this field changes, the funnel_completed hook is triggered. |
meta ⇒ converted | Boolean | Flag that is toggled when an email or phone number is submitted.
When this field changes, the new_lead hook is triggered. |
profile | Object | An object that contains all the information about forms and responses of the contact.
See below for more details. |
Profile structure
Each part of the profile is accessible via an identifier
and contains two pieces of information: a value
and a title
.
The value
is the text or answer text that the visitor clicked on or filled in. The title
represents an identifier that is human-readable; for example, in a media question block, the question sentence that appears above the boxes would qualify as the title.
Text response boxes and media response boxes receive their ID from the system. This way, it is an alphanumeric string.
Input boxes contain default settings:
Name | Identifikator |
Full name |
|
First name |
|
Last name |
|
| |
Phone |
|
Website |
|
Street |
|
Postal code |
|
City |
|
Country |
|
These values are standardized identifiers that match integration schemes such as Hubspot.
Input scheme
The title of input fields resembles their placeholder.
Note💡 You can add a . to the identifier, which is treated as "one level down" logic. The following package is used internally:https://lodash.com/docs/#get |
Details
The message, custom text, and checkbox contain editable identifiers (system IDs by default). This way, you can decide about the look of the data.
Default ID of the free text field (aka. message field)
Renamed ID of the free text field (aka. message field)
Custom Text Input
Default Checkbox ID
Custom Checkbox ID
Reply Boxes (Media/Text)
Scheme
Example
Multiple choice selection
The value is the selected list divided by a ;.
System fields
Some of the fields are automatically set by the system itself.
Cookies
The moment your visitor accepts cookies, the system keeps track of which cookies were accepted. The value is a list separated by ;. The string can also be empty if no integration is accepted or no integration is configured.
Cookies when no integration is accepted or no integration is configured:
Cookies with accepted integration:
Cookies with multiple integrations accepted:
Result
Perspective stores which results pages the visitor has seen. The value is the name of the results page.
Full example
Find more information on the following topics in our Helpcenter: