Dub.co
Link management and attribution platform for modern marketing teams.
Dub.co
Link management and attribution platform for modern marketing teams.
Capabilities
| Integration | Available | Notes |
|---|---|---|
| API | ✓ | REST API for links, analytics, domains |
| MCP | - | Not available |
| CLI | - | Not available |
| SDK | ✓ | TypeScript SDK available |
Authentication
- Type: API Key
- Header:
Authorization: Bearer {api_key} - Get key: Settings > API Keys in Dub dashboard
Common Agent Operations
Create short link
POST https://api.dub.co/links
{
"url": "https://example.com/landing-page",
"domain": "link.example.com",
"key": "summer-sale",
"tagNames": ["campaign:summer", "channel:email"]
}Get link by key
GET https://api.dub.co/links?domain=link.example.com&key=summer-saleList links
GET https://api.dub.co/links?domain=link.example.com&page=1Get link analytics
GET https://api.dub.co/analytics?domain=link.example.com&key=summer-sale&interval=30dGet clicks by location
GET https://api.dub.co/analytics?groupBy=countries&domain=link.example.com&key=summer-saleGet clicks by device
GET https://api.dub.co/analytics?groupBy=devices&domain=link.example.com&key=summer-saleUpdate link
PATCH https://api.dub.co/links/{link_id}
{
"url": "https://example.com/new-landing-page",
"tagNames": ["campaign:summer", "channel:social"]
}For link creation and updates, use tagNames for names or tagIds for existing tag IDs. The CLI's --tags flag takes comma-separated names and sends tagNames. The response's tags field contains tag objects.
Delete link
DELETE https://api.dub.co/links/{link_id}Bulk create links
POST https://api.dub.co/links/bulk
[
{"url": "https://example.com/page1", "key": "page1"},
{"url": "https://example.com/page2", "key": "page2"}
]The country and device breakdowns use the groupBy query parameter on GET /analytics. The CLI accepts --interval for each analytics subcommand.
TypeScript SDK
Install
npm install dubUsage
import { Dub } from "dub";
const dub = new Dub({ token: "YOUR_API_KEY" });
// Create link
const link = await dub.links.create({
url: "https://example.com",
domain: "link.example.com"
});
// Get analytics
const analytics = await dub.analytics.retrieve({
domain: "link.example.com",
key: "summer-sale"
});Key Features
- Custom domains - Use your own branded domains
- Link analytics - Clicks, locations, devices, referrers
- Tags - Organize links by campaign, channel, etc.
- QR codes - Auto-generated for each link
- Password protection - Secure sensitive links
- Expiration - Time-limited links
- Geo-targeting - Redirect based on location
Analytics Dimensions
clicks- Total click countcountry- Clicks by countrycity- Clicks by citydevice- Clicks by device typebrowser- Clicks by browseros- Clicks by operating systemreferer- Clicks by referrer
When to Use
- Creating trackable marketing links
- Building referral link systems
- Tracking campaign attribution
- A/B testing landing pages via links
- Generating branded short URLs
- Analyzing link performance
Rate Limits
- Free: 1,000 links, 5 API requests/second
- Pro: Unlimited links, 50 API requests/second
- Enterprise: Custom limits
Relevant Skills
- referrals
- analytics
- ads
Source: https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/dub-co.md
Author: coreyhaines31, Marketing skills. License: MIT.
Shown here with formatting for the web. Keep the author and license notice when you reuse it.
Related entries
There are more like this in the members library
The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.