Through Zapier it is possible to send events to our API without having to set up a server. Below is an example based on Facebook leads, where you send data from forms in Facebook to Spotler Activate.
Configuring a trigger
First, you create a new Zap in Zapier, with the relevant app, in this case Facebook Lead Ads. Depending on the app, different events are possible, here we want to select a new lead as trigger:
Next, select the correct account, page and form. Depending on your chosen app, the configuration may differ, but you should select the relevant form with data at the 'set up trigger' step. At test trigger you can check, if the form is already live, if the data Zapier receives is what you expect.
Configure action
Next, create an action. The app here is 'Webhooks by Zapier' and the Action Event is a Custom Request:
For the action itself, the method is 'POST', the URL is https://api.squeezely.tech/v1/track (taken from our API documentation) and Data Pass-Through is set to false
Next comes the part where you have to configure it yourself, based on what data you want to transfer from the form. You can also pass static data, in the example below we retrieve the email address, name and gender but fill in the language and source with a fixed string. The name of the event is 'FBLeads' but you can choose this yourself.
{
"events": [
{
"event": "FBLead",
"firstname": "{{Voornaam}}",
"lastname":"{{Achternaam}}",
"email":"{{E-mailadres}}",
"gender":"{{Geslacht}}",
"custom_taal":"nl",
"custom_bronnb":"facebook"
}
]
}
You copy the code above, and every part between { characters are dynamic values that you can have Zapier automatically fill in. At the bottom of the input field is "Insert Data" which you can always use to insert a variable. Note that both variables and static strings must be closed by "-signs.
Next, you can leave the 'Unflatten' and Basic auth options default and configure extra headers. There are three of these, the first two of which depend on your merchant:
- X-AUTH-ACCOUNT: Account ID in settings
- X-AUTH-APIKEY: API key in settings
- Content-Type: application/json
When you press continue, you can test the Zap with a received sample form. Normally you will see a confirmation in Zapier that it is successful, and you will see the event in Spotler Activate under 'Data' as well as on the profile that is created / completed.
If you get any error messages, please check our API documentation.