Webhook
Publishing your tracking plan to a Webhook
Introduction
The Webhook integration is a way to get your updated Tracking Plan distributed to an endpoint of your choice. This happens when a branch is merged or when the publish button is clicked in the integration interface.
Configure the Webhook integration
Webhook URL
To enable the Webhook integration you need to configure it with a URL where you want the updated tracking plan to be delivered.
The Tracking Plan will be delivered with a POST
request containing the Tracking Plan on a JSON format. The only requirement for this endpoint is to return a 200
response status code when it has successfully received the tracking plan.
Payload Format
Currently there are three different payload formats you can choose from for the webhook: Snowplow Schemas, Avo Json, and Json Schema (default).
💡 To see a preview of the exact Webhook payload in your Avo workspace choose
Publishing
in the sidebar, then pick your Webhook from the menu and expand thePayload preview
section
Snowplow Schemas
Json containing a Snowplow Schema for every event included in the Publishing integration. These schemas can for example be used to integrate Avo with Snowplow Iglu.
You can provide your own vendor value via the “Vendor” input in the publishing integration config.
Attribute | Type | Description |
---|---|---|
eventSchemas | array(Snowplow Event Schema) | Schema for every event in your tracking plan, following the Snowplow Schema format |
contextSchemas | array(Snowplow Context Schema) | Schema for every Snowplow context in your tracking plan, following the Snowplow Schema format |
context | { publishInfo: PublishInfo } | Metadata about the webhook call |
Avo Json
Json representation of the state of your entire Avo workspace. Currently behind a feature flag. Contact us to enable.
Attribute | Type | Description |
---|---|---|
model | Avo Model | Json representation of your entire Avo workspace |
context | { publishInfo: PublishInfo } | Metadata about the webhook call |
Json Schema (default)
Json representation of your tracking plan, following the Json Schema standard. Example payload can be found here
Attribute | Type | Description |
---|---|---|
name | string | The name of your Avo workspace |
events | array(Event) | Array of Tracking Plan events |
metrics | { metricId: Metric … } | Objet where each Tracking Plan metric is a field, keys are metric ids |
sources | { sourceId: Source … } | Objet where each Tracking Plan source is a field, keys are source ids |
destinations | { destinationId: Destination … } | Objet where each Tracking Plan destination is a field, keys are destination ids |
categories | { categoryId: Category … } | Objet where each Tracking Plan metric is a field, keys are category ids |
context | { publishInfo: PublishInfo } | Metadata about the webhook call |
Event Model
Attribute | Type | Description |
---|---|---|
id | string | Event id |
name | string | Event name |
eventType | enum: [“event”, “variant”] | Indicates if this event is based on an event or an event variant |
description | string | Event description and the list of triggers |
rules | Rules | Event JSON rules |
tags | array(string) | Array of all tags attached to event |
categories | array(string) | Array of category ids this event is attached to |
triggers | array({id, description, sourceIds, link, imageUrl}) | Details about all triggers attached to event |
sources | array({id, name, implementWithCodegen, destinations}) | Details about all sources sending event |
variantName | optional string | If the event is generated from an event variant, this field is provided, contains the event variant name |
Each event variant is represented by a standalone event in the JSON payload. It will have the same name
, as the base event. Additionally, it will have the variantName
field included, with the event variant name defined in the Avo Tracking Plan.
You can distinguish an event, that is generated from a variant, from a base/standalone event, by checking the eventType
field.
The eventType
of events that are generated from variants is variant
, while regular events have it as event
.
Rules Model
Attribute | Type | Description |
---|---|---|
properties | PropertiesRule | Properties JSON rules |
nameMappings | array(NameMapping) | Name mappings defined for given event |
PropertiesRule Model
Attribute | Type | Description |
---|---|---|
properties | array(PropertyRule) | Property JSON rules |
PropertyRule Model
Attribute | Type | Description |
---|---|---|
description | string | Property description |
type | string | Property type |
nameMappings | array(NameMapping) | Name mappings defined for given property |
?const | Depends on the property type | Pinned property value |
?enum | array(string) | Allowed enum values |
?operations | array(string) | Array of property ops, e.g. “SnowplowContext” |
?pattern | string | Regex pattern for string type properties |
NameMapping Model for regular workspaces
Attribute | Type | Description |
---|---|---|
name | string | New mapped name |
destinationId | string | Either a destination id for which this event/property mapping applies, or “all”, meaning that this event/property mapping applies to all destinations |
NameMapping Model for global workspaces in an Organization
Attribute | Type | Description |
---|---|---|
name | string | New mapped name |
workspaceId | string | Either a workspace id for which this event/property mapping applies, or “all”, meaning that this event/property mapping applies to all local workspace in the Organization |
Metric Model
Attribute | Type | Description |
---|---|---|
id | string | Metric id |
name | string | Metric name |
description | string | Metric description |
categories | array(string) | Category ids where this metric is included |
type | string | One of Proportion / EventSegmentation / Funnel / Retention |
items | array of Nested Event | Event descriptions |
Nested Event Model
Attribute | Type | Description |
---|---|---|
eventId | string | Event id |
where | array(whereFilter) | Array of where filters |
groupBy | array(groupByFilter) | array of objects containing property ids to group by |
groupByFilter
Attribute | Type | Description |
---|---|---|
propertyId | string | property Id being used in group filter |
Where filter
Attribute | Type | Description |
---|---|---|
propertyId | string | property id |
operation | string | binary operation as string |
values | array(t) | array of values of the same type |
Source Model
Attribute | Type | Description |
---|---|---|
id | string | Source id |
name | string | Source name |
programmingLanguage | string | Name of programming language (e.g. “JavaScript”, “Python”) |
developmentPlatform | string | Name of development platform (e.g. “Web”, “Android”) |
destinations | array(string) | Destination ids where this source sends data to |
Destination Model
Attribute | Type | Description |
---|---|---|
id | string | Destination id |
name | string | Destination name |
type | string | Name of the provider (e.g. “Segment”, “Mixpanel”) where the data is sent to if managed by Avo, “Custom” otherwise. |
Category Model
Attribute | Type | Description |
---|---|---|
id | string | Category id |
name | string | Category name |
description | string | Category description |
metrics | array(string) | Metric ids belonging this category |
events | array(string) | Event ids belonging this category |
PublishInfo Model
Attribute | Type | Description |
---|---|---|
branchId | string | Branch id |
branchName | string | Branch name |
integrationId | string | Id of the publish integration (consistently the same for this integration) |
integrationName | string | Name of the publish integration (seen in Tracking Plan -> publishing -> ‘IntegrationName’) |
publishDate | Date string | Timestamp when the webhook was triggered |
publishMethod | { “type”: type } | Description of the publish method, type can be “Manual” and “BranchMerge” |
lastUpdateId | id | Unique identifier of the last modification made to the tracking plan before the generation of this schema |
lastUpdateDate | Date string | Time of the last modification made to the tracking plan before the generation of this schema |
organization | Organization Model | Provided if the workspace being published belongs to an organization |
Organization Model
Attribute | Type | Description |
---|---|---|
organizationId | string | Organization id |
globalWorkspaceIds | array(string) | List of all global workspaces in Organization |
localWorkspaceIds | array(string) | List of all local workspaces in Organization |
workspaceType | string | Describes the type of the workspace being published, “local” or “global” |