Send Dub webhooks to Tinybird

With Dub you shorten any link and get rich analytics. By integrating Dub with Tinybird, you can analyze your link usage data in real time.

Some common use cases for sending Dub webhooks to Tinybird include:

  1. Tracking link clicks.
  2. Monitoring link performance.
  3. Analyzing user engagement patterns.
  4. Creating custom dashboards for link performance.
  5. Enriching other data sources with real-time link metrics.

Read on to learn how to send data from Dub to Tinybird.

Before you start

Before you connect Dub to Tinybird, ensure:

  • You have a Dub account.
  • You have a Tinybird Workspace.

Connect Dub to Tinybird

  1. Open the Dub UI and go to the Settings > Webhooks page.

  2. Select Create Webhook.

  3. In Tinybird, create a Data Source, called dub. You can follow this schema:

SCHEMA >
  `event_time` DateTime `json:$.tinybirdIngestTime` DEFAULT now(),
  `event_type` String `json:$.event` DEFAULT 'unknown',
  `event` JSON(max_dynamic_types=2, max_dynamic_paths=16) `json:$` DEFAULT '{}'

ENGINE "MergeTree"
ENGINE_PARTITION_KEY "toYYYYMM(event_time)"
ENGINE_SORTING_KEY "event_time"

Using the JSON Data Type you can store the semi-structured data you receive from Dub in a single column. You can later retrieve various events and their metadata as needed in your Pipes.

The JSON data type is in private beta. If you are interested in using this type, contact Tinybird at support@tinybird.co or in the Community Slack.

  1. In Tinybird, copy a token with privileges to append to the Data Source you created. You can use the admin token or create one with the required scope.

  2. Back in Dub, paste the Events API URL as your webhook URL. Use the query parameter name to match the name of the Data Source you created in Tinybird. For example:

https://api.tinybird.co/v0/events?name=dub&token=<your user token>

Replace the Tinybird API hostname or region with the API region that matches your Workspace.

  1. Select the checkboxes for the Dub events you want to send to Tinybird, and select Create webhook.

  2. You're done. Dub will now push events to Tinybird via the Events API.

See also

Updated