Webhook integration

How to set up a webhook to transfer campaign data to your CRM or ESP

Niklas Cuthbert Mehlsen avatar
Written by Niklas Cuthbert Mehlsen
Updated over a week ago

A webhook is a simple way of transferring data from a Playable campaign to any CRM or ESP.

If you cannot use one of our pre-built API integrations, you can likely use a webhook. Webhooks are also often used to add an identifier (e.g. email or userID) to a record before the data is sent to the CRM or in connection with a Zapier workflow.

Difference between a webhook and an API integration

Unlike an API integration, a webhook doesn't search in a database to see if the information is already there. Instead, it just sends the data shortly after the registration on the Playable campaign takes place.

This means you do not have the option to update an existing contact or to only send contacts who are new to your database.

Instead, you should have a process or flow set up on the receiving end to accept and "wash" the data as it comes in. Whether this cleanup is a manual process or is done automatically by the CRM depends on your system.

Setting up a webhook in Playable

You can add a webhook to a campaign under Integrations > Misc. > Webhook

Configuring a webhook

  1. Select the Event type. This "event" is what happens on your campaign to trigger the webhook. Typically, you will use the Terms & Conditions field in your registration form.

  2. Enter your URL endpoint. This is where the data will be sent.

  3. Select your request type (GET or POST). To send information, you will use the POST method.

  4. Choose your content type: URL encoded (also called "Form") or JSON

Authentication

Webhooks deliver data to publicly accessible URLs. This means that anyone β€” the webhook provider, or anyone else on the internet β€” can send HTTP requests to your endpoint. That's why we provide authentication options in the webhook settings.

The setup you use will depend on the requirements of your system and the level of security you would like to have.

Oauth 2.0 authentication method is the most secure you can use. Bearer and Basic Auth authentications also help you secure your integration.

Having no authentication, on the other side, is the least secure set-up you can have. If you do not have authentication, to add a layer of security you can, for example, add a token to a header.

Mapping data

Once your webhook settings are configured, you can start mapping your data fields.

Each of the fields must be manually defined, as the webhook cannot connect to your database to see what the different user attributes are called. You will need to know the name of the attribute and type it in under each field.

For example, if you have a field in your registration form called "First name" and you want to send to your endpoint where the attribute is named "first_name", you will map the field like this:

As with other integrations, you can choose to map data collected via:

  • The registration form fields (e.g. name and email)

  • The campaign (e.g. campaign name and IP address)

  • The game flow (e.g. winner / loser / other game result)

Testing your webhook

You can use the test function at the bottom of the integration settings, but we recommend you play the game through in the frontend and register to fully test the webhook. You can test using the Demo URL (you don't have to publish the campaign to test the integration).

You can see under Activity > Registrations if your information has been successfully delivered. Click "watch log" to investigate.

Did this answer your question?