-
Notifications
You must be signed in to change notification settings - Fork 0
docs: add Zendesk webhook integration guide #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| --- | ||
| sidebar_position: 4 | ||
| --- | ||
|
|
||
| import Admonition from "@theme/Admonition"; | ||
|
|
||
| # Zendesk Integration | ||
|
|
||
| This guide explains how to send Zendesk support ticket events as goal events to ABsmartly | ||
| using [Zendesk Webhooks](https://support.zendesk.com/hc/en-us/articles/4408839108378-Creating-webhooks-to-interact-with-third-party-systems). | ||
| 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 | ||
|
|
||
| 1. **ABsmartly account** with access to the Web Console and a valid **SDK API Key**. | ||
| API Keys can be created under `Settings > API Keys` in the ABsmartly Web Console. | ||
| 2. **Zendesk account** with Admin access to create webhooks and triggers. | ||
| 3. A **unit type** (e.g. `user_id` or `email`) 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 | ||
|
|
||
| 1. In Zendesk, go to **Admin Center > Apps and integrations > Webhooks > Webhooks**. | ||
| 2. Click **Create webhook**. | ||
| 3. Select **Trigger or automation** as the connection method and click **Next**. | ||
| 4. 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` | ||
| 5. Under **Authentication**, select **API key** and configure it: | ||
| - **Header name**: `X-API-Key` | ||
| - **Value**: Your ABsmartly SDK API Key | ||
| 6. 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` | | ||
|
|
||
| 7. Click **Create webhook**. | ||
|
|
||
| <Admonition type="info"> | ||
| The <code>X-Application</code> and <code>X-Environment</code> values must match | ||
| existing entries in your ABsmartly Web Console under <code>Settings > Applications</code> | ||
| and <code>Settings > Environments</code>. | ||
| </Admonition> | ||
|
|
||
| ## Step 2 — Create a Trigger to Send the Webhook | ||
|
|
||
| 1. In Zendesk, go to **Admin Center > Objects and rules > Business rules > Triggers**. | ||
| 2. Click **Create trigger**. | ||
| 3. Give the trigger a name, for example: `Send ticket to ABsmartly`. | ||
| 4. 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` | ||
| 5. Under **Actions**, select **Notify webhook** and choose the `ABsmartly Goal Event` | ||
| webhook you created in Step 1. | ||
| 6. In the **JSON body** field, enter the following payload: | ||
|
|
||
| ```json | ||
| { | ||
| "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}}" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
Comment on lines
+67
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "*Zendesk*" | head -20Repository: absmartly/docs Length of output: 113 🏁 Script executed: git ls-files | grep -i zendesk | head -20Repository: absmartly/docs Length of output: 111 🏁 Script executed: git ls-files docs/Third-party-integrations/ | head -30Repository: absmartly/docs Length of output: 805 🏁 Script executed: cat -n docs/Third-party-integrations/Zendesk-Integration.mdx | sed -n '50,100p'Repository: absmartly/docs Length of output: 2030 🌐 Web query:
💡 Result:
🌐 Web query:
💡 Result: In the ABsmartly Collector API Publish Experiment Events endpoint (
Although the docs don’t explicitly state the unit, the example values (e.g., Source: Citations: 🏁 Script executed: cat -n docs/Third-party-integrations/Zendesk-Integration.mdx | sed -n '1,66p'Repository: absmartly/docs Length of output: 3423 🏁 Script executed: cat -n docs/Third-party-integrations/Zendesk-Integration.mdx | sed -n '90,150p'Repository: absmartly/docs Length of output: 3171 The sample payload is incompatible with the documented schema. The Payload Reference (line 113) correctly specifies that 🤖 Prompt for AI Agents |
||
|
|
||
| 7. Click **Save**. | ||
|
|
||
| <Admonition type="tip"> | ||
| Adjust the <code>units</code> type and value to match the unit type you use in your | ||
| ABsmartly experiments. For example, if your experiments use a <code>user_id</code> unit, | ||
| you may need to use a custom Zendesk user field that contains the user ID instead of | ||
| the email address. | ||
| </Admonition> | ||
|
|
||
| ## Step 3 — Create the Goal in ABsmartly | ||
|
|
||
| 1. In the ABsmartly Web Console, go to **Settings > Goals**. | ||
| 2. Create a new goal named `zendesk_ticket_created` (matching the `name` in the webhook payload). | ||
| 3. You can now use this goal to create metrics. | ||
|
|
||
| ## Payload Reference | ||
|
|
||
| The webhook payload follows the [ABsmartly Collector API](/docs/APIs-and-SDKs/SDK-API/context-publish) | ||
| `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](https://support.zendesk.com/hc/en-us/articles/4408886858138-Zendesk-Support-placeholders-reference) | ||
| 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 > Solved` | ||
| and set the goal name to `zendesk_ticket_solved`. | ||
| - **High-priority ticket** — Create a trigger with the condition `Ticket > Priority > Is > Urgent` | ||
| and set the goal name to `zendesk_urgent_ticket_created`. | ||
|
|
||
| ## Verifying the Integration | ||
|
|
||
| 1. Create a test ticket in Zendesk from a user whose identifier (e.g. email) is also | ||
| being tracked in an ABsmartly experiment. | ||
| 2. Check the ABsmartly Web Console under the experiment's goals to verify | ||
| that the `zendesk_ticket_created` event was received. | ||
| 3. 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 | ||
| [support@absmartly.com](mailto:support@absmartly.com). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n docs/Third-party-integrations/Zendesk-Integration.mdx | head -40Repository: absmartly/docs
Length of output: 2089
🌐 Web query:
ABsmartly Collector API context publish endpoint documentation💡 Result:
ABsmartly Collector API — Context “publish” endpoint
PUT /v1/context(example base URL shown in docs:https://sandbox.absmartly.io) [1]Authentication
X-API-Key: <your key>(apiKey auth) [2]Required request headers
X-Agent(SDK user-agent string, e.g.absmartly-Java-SDK v1.0.1) [1]X-Environment(e.g.development) [1]X-Application(e.g.www) [1]X-Application-Version(int64) [1]JSON request body (high level)
publishedAt(int64 timestamp; required) [1]units(array; required) — objects withtypeanduid[1]hashed(bool),historic(bool) [1]exposures(experiment exposure events) [1]goals(tracked goal events) [1]attributes(context attributes for segmentation) [1]Response (success)
okplus optionalwarnings[]/errors[]entries (each includesbatchIndex,eventIndex,subject,message) [1]Sources: Publish Experiment Events (context publish) [1]; Collector API overview/auth scheme [2].
[1] (docs.absmartly.com)
[2] (docs.absmartly.com)
Citations:
Specify
/v1/contextin the endpoint instructions.Line 30 instructs to append
/context, but the ABsmartly Collector API endpoint is documented asPUT /v1/context. The example on line 31 is correct; updating the prose to explicitly reference/v1/contextwill prevent readers from omitting the version prefix.🤖 Prompt for AI Agents