Introduction
Learn how to use Dub’s Analytics API to build real-time analytics dashboards for your links.
Analytics endpoints require a Pro plan subscription or higher.
Dub’s Analytics API allows you to build real-time analytics dashboards for your links that lives directly inside your application.
Fundamentals
At a high level, Dub’s Analytics API allows you to retrieve data about your links by event type and group by different dimensions.
Dub’s Analytics API supports the following event
types:
clicks
– the number of clicks on a linkleads
– the number of leads generated from a linksales
– the number of sales generated from a link
Each of these events can be aggregated in different ways by using the groupBy
parameter:
Example queries
Here are some examples of how to retrieve data using Dub’s Analytics API:
Total event count
Timeseries data
Top links by event
Example apps
With Dub’s Analytics API, you can build user-facing analytics dashboards with the real-time click and conversion data for your links.
Here are some open-source examples of how you can use the Analytics API to build your own custom analytics dashboards:
OSS Gallery
Programmatically shorten links and fetch real-time click analytics with Dub
Cap.so
How Cap.so fetches real-time click analytics for their recording links
And here’s another real-world example of a custom analytics dashboard built with the Analytics API:
Was this page helpful?