Webhooks: Audience Triggers
Use this job to send Lytics audience enter/exit event triggers to your webhooks URL. If you use webhooks to export an audience that relies on a time-based trigger, for example, users who have been modified within a window of time, it is important that the window be at least 30 minutes. Smaller windows may not be reliable due to the pipeline necessary for checking audience membership at a specific time.
Integration Details
- Implementation Type: Server-side.
- Type: REST API.
- Frequency: Real-time, with an optional one-time backfill of the audience after setup.
- Resulting Data: Lytics user fields sent to webhooks URL.
Fields
By default, the job will send all the user fields as a JSON payload of the POST request to the configured webhooks URL. There are two kinds of JSON payloads for POST requests: new and old format.
New format (default):
{
"id": "7076027172059065053",
"data": {
"_created": "2020-07-15T08:55:43.041-07:00",
"_cust_sz": 118,
"_internal_sz": 33,
"_modified": "2020-07-15T08:55:43.041-07:00",
"_num_aliases": 1,
"_num_conflicts": 0,
"_num_days": 1,
"_num_events": 1,
"_num_streams": 1,
"_split": 12,
"_streamnames": [
"default"
],
"_total_sz": 151,
"channels": [
"web"
],
"email": "[email protected]",
"first_name": "Beth",
"firstvisit_ts": "2020-07-15T08:55:43.041-07:00",
"hourly": {
"15": 1
},
"hourofweek": {
"87": 1
},
"is_bot": "f",
"is_mobile": "t",
"last_active_ts": "2020-07-15T08:55:43.041-07:00",
"last_channel_activities": {
"web": "2020-07-15T08:55:43.041-07:00"
},
"last_name": "Izzi",
"lastvisit_ts": "2020-07-15T08:55:43.041-07:00",
"name": "Beth Izzi",
"score_frequency": 99,
"score_intensity": 0,
"score_momentum": 99,
"score_propensity": 0,
"score_quantity": 100,
"score_recency": 100,
"segment_events": [
{
"id": "42976a269a5e6b9d06c681b1c27292df",
"event": "enter",
"slug": "emailzz5",
"enter": "2020-10-14T13:27:33.916374949-07:00"
}
],
"user_agent": "python-requests",
"user_attributes": {
"value": "681"
}
},
"meta": {
"object": "user",
"subscription_id": "36e243f8fd8f4530bbd330fa7fb1a685",
"timestamp": "2020-10-14T13:27:34.038154562-07:00"
}
}
Old format:
{
"id": "12645278470990184693",
"data": {
"_audience": "42976a269a5e6b9d06c681b1c27292df",
"_audience_action": "entered",
"_audience_friendly": "emailzz5",
"_audience_name": "Email-zz-5",
"_created": "2020-07-15T08:55:43.887-07:00",
"_cust_sz": 132,
"_internal_sz": 33,
"_modified": "2020-07-15T08:55:43.887-07:00",
"_num_aliases": 1,
"_num_conflicts": 0,
"_num_days": 1,
"_num_events": 1,
"_num_streams": 1,
"_split": 64,
"_streamnames": [
"default"
],
"_total_sz": 165,
"channels": [
"web"
],
"email": "[email protected]",
"first_name": "Tami",
"firstvisit_ts": "2020-07-15T08:55:43.887-07:00",
"hourly": {
"15": 1
},
"hourofweek": {
"87": 1
},
"is_bot": "f",
"is_mobile": "t",
"last_active_ts": "2020-07-15T08:55:43.887-07:00",
"last_channel_activities": {
"web": "2020-07-15T08:55:43.887-07:00"
},
"last_name": "Palazzi",
"lastvisit_ts": "2020-07-15T08:55:43.887-07:00",
"name": "Tami Palazzi",
"score_frequency": 99,
"score_intensity": 0,
"score_momentum": 99,
"score_propensity": 0,
"score_quantity": 100,
"score_recency": 100,
"user_agent": "python-requests",
"user_attributes": {
"value": "894"
}
},
"collected": "2020-10-14T13:26:51.573749824-07:00",
"table": "user",
"segment_events": [
{
"id": "42976a269a5e6b9d06c681b1c27292df",
"event": "enter",
"slug": "emailzz5",
"enter": "2020-10-14T13:26:51.573752371-07:00"
}
],
"subscriptionid": "d74d66c3db5cd241838243cb8dd48108"
}
Configuration
Follow these steps to set up and configure an Audience Trigger Webhooks. If you are new to creating jobs in Lytics, see the Jobs Dashboard documentation for more information.
- Select Webhooks from the list of providers.
- Select the Audience Triggers Webhook job type from the list.
- Select the authorization you previously created or proceed selecting Use Webhook endpoint does not require authorization instead option.
- Enter a Label to identify this job you are creating in Lytics.
- (Optional) Enter a Description for further context on your job.
- From the Audiences list, select the Lytics audiences that you would like to emit events from.
- In the Webhook URL textbox, enter your webhooks URL that accepts the POST request with content
application/json
. - (Optional) From the Export Fields, select the list of Lytics user fields that you would like to export. If none are selected, the job will export all the user fields by default.
- (Optional) Select the Existing Users checkbox to emit events for the user that are already part of the selected Lytics audience. They will be sent as
entered
event type. - (Optional) Select the User Legacy Message Format checkbox to use the old format for the payload. See fields section for more information on the format types.
- (Optional) In Parallel Request Count textbox, enter the parallel request count that the webhooks URL can process at a time. This count affects the rate at which the events will be exported.
- Click Start Export.