Send Events From Any Platform With a Webhook
Sending data to Tracklution with webhooks
A webhook is a tool that allows different systems to communicate with each other in real time. In essence, it’s a way for one application to send automatic data updates to another as soon as a certain event occurs. This eliminates the need for constant polling and ensures that information flows seamlessly between platforms.
You can utilise the webhook to send in events that happen outside of your website (“offline conversions”). These conversion events could be for example phone calls, purchases made in brick-and-mortar shops, bookings made in a booking system, validated leads in a CRM system, and so forth.
Events registered via webhook can be matched to web sessions if matching data is available (read more below "Matching webhook data with other session data"). In case matching data is not available, webhook events will be handled as an individual session and can be delivered via Connectors with Click ID or without original click ID data as enhanced conversions (if in use).
You can either send new events with the webhook ("Track" -type webhooks), or enrich already existing sessions with new data coming from the webhook ("Set"-type webhooks). You don’t need to explicitly define the event type in the webhook parameters - Tracklution automatically determines whether the webhook is a set or track event based on whether the track parameter is present. Examples of each can be found below, in "Request examples".
Video walk-through
In the video below, we show how to send offline conversions with a webhook in two ways:
- Using the platform’s own automation tool (example from Zoho CRM)
- Using Zapier as a middleware (starting from 15:30)
How to send events to Tracklution with webhooks (where to get the webhook URL)
A webhook endpoint URL is needed to send webhooks to Tracklution. The webhook endpoint URL is a web address where one system automatically sends data or notifications to another system when something happens (for example, when a purchase is completed or a booking is made). The Tracklution Webhook Endpoint URL is available on your Tracklution dashboard, under "Webhook":
For platform-specific instructions on sending offline-events, refer to these articles:
Webhook query parameters
Query parameters are additional key–value pairs added to the URL that tell the receiving system what the request contains and how it should be processed. When making a GET request to the endpoint, following query parameters can / need to be set:
Sending custom parameters with Webhooks
In addition to standard webhook parameters (such as value, currency, externalId, and contact fields), you can send custom event-level data with your webhook events. Custom parameters must be included inside a dedicated object called event_attributes in the webhook payload.
Example 1: Basic webhook event (no custom parameters) This example sends a simple conversion event with a value and identifiers only:
{
"track": "Purchase",
"value": 99.00,
"currency": "EUR",
"externalId": "order-12345",
"email": "customer@example.com"
}{
"track": "Purchase",
"value": 99.00,
"currency": "EUR",
"externalId": "order-12345",
"email": "customer@example.com",
"event_attributes": {
"plan": "Premium",
"billingPeriod": "Annual",
"sourceSystem": "CRM"
}
}Request examples
You don’t need to explicitly define the event type in the webhook parameters - Tracklution automatically determines whether the webhook is a set or track event based on whether the track parameter is present.
"Track" -type webhook:
Use "Track"-type webhooks if you want to register new events. You can add as many parameters as you like (see the list "Webhook query parameters" above). Example of a FromSubmission event sent with a webhook from Zapier together with email and phone number:
- Webhook setup in Zapier:
- The same webhook event in Tracklution container's Webhook-tab:
- The same webhook event on the container dashboard:
"Set" -type webhook:
Use "Set"-type webhooks if you want to enrich already existing session data. You can add as many parameters as you like (see the list "Webhook query parameters" above). Example of data sent with a webhook from Zapier that will enrich already existing data on a session with email and phone number, but not create a new event:
- Webhook setup in Zapier:
- The same webhook event in Tracklution container's Webhook-tab:
- The session on the dashboard, that the webhook enriches before and after the data (email & phone number) is received from the webhook (Tracklution is using the externalId to match the webhook to the correct session):
Matching webhook data with other session data
When you send webhook data to Tracklution, it is important to ensure the data can be matched to an existing website session. Tracklution’s webhook automatically matches webhook data to a correct session/set of web events if matching data is available. If matching data is not available Tracklution will still be able to register and store the data and match it later if matching sessions appear. If you are sending in an event via webhook, it can be processed as an individual event and passed on to Ad Platforms with the Click ID or as an enhanced conversion in case click ID is not available from the original session.
Using Data from ContactInfo pixel (preferred) for matching
Set a ContactInfo tag to fire on during the website session so Tracklution will use that data to match the webhook data with the session. You can use unique external ID, email or phone number.
Unique external ID (‘externalId’): External ID is a unique value generated and passed from web to Tracklution. External ID should be a value that you have available in both, web and in the backend system you’re sending webhook data from. With External ID Tracklution is able to accurately match webhook data with the session data from web. External ID is passed from the web with the ContactInfo pixel. It can be grouped to another event (as in the example) or sent as an individual ContactInfo event.
Email address (‘email’): Email address can be collected via web and passed on to Tracklution with the ContactInfo pixel at any given point of the user journey. By passing the same email address via webhook’s ‘email’ field, Tracklution will be able to match webhook data with data collected via pixels.
Phone number (‘phoneNumber’): Phone number can be collected via web and passed on to Tracklution with the ContactInfo pixel at any given point of the user journey. By passing the same phone number via webhook’s ‘phone’ field, Tracklution will be able to match webhook data with data collected via pixels.
Example
You have installed a ContactInfo tag to be firing during a website session, the ContactInfo tag that is fired looks like this;
You are also sending a Purchase-event with a webhook from an external platform. You collect the same externalId to the external platform, which you also collect from the website session with the ContactInfo tag. The webhook POST request looks like this;
Tracklution uses the external id to match the Purchase-event from the webhook to the website session. If external id would not be available, other contact data (email, phone number) would be used for matching.
Using other data for matching
Timestamp: While the above mentioned identifiers are the most accurate and preferred ways to match webhook data, if no other data is available, Tracklution will try to match data based on timestamps. However, this requires that the webhook is arriving at the same time as the session is recorded via pixels. For example, if only relying on timestamp, webhook has to arrive at the same time with the purchase event, and especially with plenty of volume there is a possibility for mismatch. Matching with timestamp only might cause low match confidence levels and is thus not recommended.