Webhooks
Creating the webhook
In Personizely you can set up a webhook to be send when a certain action is done on a widget. To create a webhook for a widget, follow the guide below:
Edit the element on which you want to attach a webhook:
Add an automation:
Set the URL where you want to direct the hook:
You're all set, now Personizely will send a HTTP request to the URL provided once someone submits/click on the edited form/element:
Receiving the webhook
The webhooks are send using a POST request with a JSON payload which your script should parse and then return a 200 HTTP status.
Webhook's JSON format is the following:
{
"widgetId": Number,
"event": String - click/submit,
"visitorData": Object {
"firstName": String,
"lastName": String,
"email": String,
"companyName": String,
"companyTItle": String,
"phone": String,
"address": String,
"marketingConsent": Boolean,
"privacyContent": Boolean,
"bio": String,
"initialReferrer": String,
"utmSource": String,
"utmCampaign": String,
"utmContent": String,
"utmTerm": String,
"utmMedium": String,
"entryPage": String,
"firstVisitDate": String,
"country": String,
"city": String,
"region": String,
"postalCode": String,
Number: String - Custom fields are serialized with the custom field id as the key
}
}
Updated on: 26/12/2021
Thank you!