Zendesk Integration
This guide explains how to send Zendesk support ticket events as goal events to ABsmartly using Zendesk Webhooks. This allows you to track support ticket creation as a metric in your experiments — for example, to measure whether a new feature reduces or increases support requests.
Prerequisites
- ABsmartly account with access to the Web Console and a valid SDK API Key.
API Keys can be created under
Settings > API Keysin the ABsmartly Web Console. - Zendesk account with Admin access to create webhooks and triggers.
- A unit type (e.g.
user_idoremail) that is shared between your ABsmartly experiments and your Zendesk tickets so that events can be attributed to the correct user.
Step 1 — Create a Webhook in Zendesk
- In Zendesk, go to Admin Center > Apps and integrations > Webhooks > Webhooks.
- Click Create webhook.
- Select Trigger or automation as the connection method and click Next.
- Fill in the webhook details:
- Name:
ABsmartly Goal Event - Description:
Sends ticket events to ABsmartly as goal events - Endpoint URL: Your ABsmartly Collector endpoint followed by
/context. For example:https://your-subdomain.absmartly.io/v1/context - Request method:
PUT - Request format:
JSON
- Name:
- Under Authentication, select API key and configure it:
- Header name:
X-API-Key - Value: Your ABsmartly SDK API Key
- Header name:
- Add the following custom headers:
| Header name | Value |
|---|---|
X-Application | The application name matching your ABsmartly Web Console (e.g. www) |
X-Application-Version | 0 |
X-Environment | The environment name matching your ABsmartly Web Console (e.g. production) |
X-Agent | zendesk-webhook |
- Click Create webhook.
info
The
X-Application and X-Environment values must match existing entries in your ABsmartly Web Console under Settings > Applicationsand Settings > Environments.Step 2 — Create a Trigger to Send the Webhook
- In Zendesk, go to Admin Center > Objects and rules > Business rules > Triggers.
- Click Create trigger.
- Give the trigger a name, for example:
Send ticket to ABsmartly. - Under Conditions, configure when the trigger should fire. For example, to fire
on every new ticket:
- Meet ALL of the following conditions:
Ticket > Is > Created
- Meet ALL of the following conditions:
- Under Actions, select Notify webhook and choose the
ABsmartly Goal Eventwebhook you created in Step 1. - In the JSON body field, enter the following payload:
{
"publishedAt": {{ticket.created_at_with_timestamp}},
"units": [
{
"type": "email",
"uid": "{{ticket.requester.email}}"
}
],
"goals": [
{
"name": "zendesk_ticket_created",
"achievedAt": {{ticket.created_at_with_timestamp}},
"properties": {
"ticket_id": "{{ticket.id}}",
"subject": "{{ticket.title}}",
"priority": "{{ticket.priority}}",
"channel": "{{ticket.via}}"
}
}
]
}
- Click Save.
tip
Adjust the
units type and value to match the unit type you use in your ABsmartly experiments. For example, if your experiments use a user_id unit, you may need to use a custom Zendesk user field that contains the user ID instead of the email address.Step 3 — Create the Goal in ABsmartly
- In the ABsmartly Web Console, go to Settings > Goals.
- Create a new goal named
zendesk_ticket_created(matching thenamein the webhook payload). - You can now use this goal to create metrics.
Payload Reference
The webhook payload follows the ABsmartly Collector API
PUT /context format. Here is a summary of the key fields:
| Field | Description |
|---|---|
publishedAt | Timestamp (Unix ms) of when the event was sent |
units | Array of unit objects identifying the user. Each has a type and uid |
goals | Array of goal objects. Each has a name, achievedAt timestamp, and optional properties |
Available Zendesk Placeholders
You can use Zendesk placeholders in the webhook payload to dynamically include ticket data. Some useful ones:
| Placeholder | Description |
|---|---|
{{ticket.id}} | The ticket ID |
{{ticket.title}} | The ticket subject |
{{ticket.requester.email}} | The requester's email address |
{{ticket.requester.name}} | The requester's name |
{{ticket.priority}} | The ticket priority |
{{ticket.via}} | The channel the ticket came from |
{{ticket.created_at_with_timestamp}} | Ticket creation timestamp |
Tracking Different Ticket Events
You can create multiple triggers to track different types of ticket events as separate goals. For example:
- Ticket solved — Create a trigger with the condition
Ticket > Status > Changed to > Solvedand set the goal name tozendesk_ticket_solved. - High-priority ticket — Create a trigger with the condition
Ticket > Priority > Is > Urgentand set the goal name tozendesk_urgent_ticket_created.
Verifying the Integration
- Create a test ticket in Zendesk from a user whose identifier (e.g. email) is also being tracked in an ABsmartly experiment.
- Check the ABsmartly Web Console under the experiment's goals to verify
that the
zendesk_ticket_createdevent was received. - You can also check the webhook activity in Zendesk under Admin Center > Apps and integrations > Webhooks by clicking on your webhook and viewing the Activity tab.
If you have any issues setting up the Zendesk integration, please contact us at [email protected].