The provided curl example (with the -F option) implies the request uses a POST method and its body is “multipart/form-data” content type. Let's break down the whole request into separate components that can be configured in the Webhook.

1. API Endpoint/URL

In the example the URL has placeholder values for the API version and the APP_ID. These could probably be hard-coded into the URL, but for demonstration purposes we'll use a URL Template to create this component using dynamic values.

3. JSON Value

This particular field named "custom_events" has a more complicated value, a JSON string. To recreate this value in the Webhook we'll use Template Variables and a Template.

Webhook Settings

Method Field

Set to “POST”.

URL Field

Set to “{{url_template}}”.

URL can either be hard coded (with embedded api version and app ID) or template based. The latter approach is taken to allow greater flexibility with data layer attributes. See templates section below.

Body Content Type

Select option “multipart/form-data”.

Body Data

Set name/value pairs for each field from the example request. Notice that the value for custom_events is the name of the Template we create, "events_template".

Facebook Field Names

Custom Value

Comment

event

CUSTOM_APP_EVENTS

advertiser_id

1111-1111-1111-1111

advertiser_tracking_enabled

1

application_tracking_enabled

1

custom_events

{{events_template}}

References the template created below

Parameter values are custom/static values in this example, but can easily be provided as dynamic Data Layer Attributes.

Templates

You will create two templates, one for the URL and one for the JSON value to be assigned to the custom_events parameter. Notice that the Templates make use of the Template Variables using the curly brackets syntax.

It's important to understand that this template is based on the "eventSums.value" variable which is populated by a Set of String Attribute. This is an array Attribute so the template will create a section for the prefix of the template variable name we used (in this case "eventSums").