Skip to main content

Get Started with Dub

This guide will walk you through creating your first short link, tracking clicks, and accessing analytics. You’ll be up and running in under 5 minutes.
1

Create an Account

Sign up for a free Dub account at app.dub.coYou can sign up with:
  • Email and password
  • GitHub
  • Google
The free tier includes 1,000 link clicks per month and unlimited links.
2

Create Your Workspace

After signing in, you’ll be prompted to create your first workspace. A workspace is a container for your links, domains, and team members.
  1. Enter your workspace name (e.g., “Acme Marketing”)
  2. Choose a workspace slug (e.g., acme)
  3. Click Create Workspace
You can create multiple workspaces to separate different projects or clients.
3

Create Your First Short Link

Now let’s create your first short link:
  1. Click the Create Link button in the dashboard
  2. Enter your destination URL (e.g., https://example.com/product)
  3. Choose your domain:
    • Use dub.sh (free default domain)
    • Or add your own custom domain
  4. Customize the short link key (optional)
    • Leave blank for a random 7-character key
    • Or enter a custom slug (e.g., product)
  5. Click Create Link
# Creates: dub.sh/abc1234
Destination URL: https://example.com/product
Domain: dub.sh
Key: (auto-generated)
Your short link is now live and ready to share!
4

Share Your Link

Copy your short link and share it anywhere:
  • Social media posts
  • Email campaigns
  • Marketing materials
  • QR codes
Click the QR code icon next to your link to generate a scannable QR code.
5

View Analytics

Click on your link in the dashboard to view detailed analytics:
  • Total clicks - Real-time click count
  • Click timeline - Clicks over time with customizable date ranges
  • Geographic data - Countries, regions, and cities
  • Devices - Desktop vs mobile breakdown
  • Browsers & OS - Browser and operating system distribution
  • Referrers - Where your traffic comes from
Dub Analytics Dashboard

Next Steps

Now that you’ve created your first link, explore Dub’s advanced features:

Add a Custom Domain

Use your own branded domain for short links

Enable Conversion Tracking

Track leads and sales beyond clicks

Use the API

Create and manage links programmatically

Advanced Link Features

Explore A/B testing, device targeting, and more

Using the API

Prefer to work with code? Create links programmatically using the Dub API:
1

Get Your API Key

  1. Go to your workspace settings
  2. Navigate to API Keys
  3. Click Create API Key
  4. Give it a name and select permissions
  5. Copy the API key (you won’t see it again!)
Keep your API key secure. Never commit it to version control or share it publicly.
2

Create a Link via API

Use the API to create a short link:
curl -X POST 'https://api.dub.co/links' \
  -H 'Authorization: Bearer <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/product",
    "domain": "dub.sh",
    "key": "product"
  }'
3

Retrieve Link Analytics

Get analytics for your link:
curl -X GET 'https://api.dub.co/analytics?domain=dub.sh&key=product&interval=7d' \
  -H 'Authorization: Bearer <your-api-key>'
Check out the API Reference for complete documentation on all available endpoints.

Using the CLI

Manage your links from the command line with the Dub CLI:
1

Install the CLI

npm
npm install -g dub-cli
pnpm
pnpm add -g dub-cli
yarn
yarn global add dub-cli
2

Login to Dub

dub login
This will open your browser to authenticate with Dub.
3

Create a Link

dub shorten https://example.com/product product
Or use the interactive prompt:
dub shorten
4

List Your Links

dub links --limit 10
Search for specific links:
dub links --search product

Common Use Cases

Marketing Campaigns

Track campaign performance with UTM parameters:
Example Link
https://dub.sh/summer-sale?utm_source=twitter&utm_medium=social&utm_campaign=summer2024
Dub automatically tracks all UTM parameters for detailed attribution.

QR Code Marketing

  1. Create a short link for your product
  2. Click the QR code icon in the dashboard
  3. Download the QR code image
  4. Add to printed materials, packaging, or signage
All QR code scans are automatically tracked with the trigger=qr parameter.

Social Media Sharing

Customize link previews for social media:
  1. Edit your link
  2. Enable Custom Link Previews
  3. Set custom title, description, and image
  4. Your short link will show your custom preview on social platforms
Custom link previews work on Twitter, Facebook, LinkedIn, and other platforms that support Open Graph tags.

A/B Testing Landing Pages

Test different landing pages with traffic splitting:
  1. Create a new link
  2. Enable A/B Testing
  3. Add multiple destination URLs with traffic percentages:
    • Variant A: 50%
    • Variant B: 50%
  4. Track which variant converts better in analytics

Troubleshooting

Analytics may take a few seconds to update:
  • Refresh the page after 10-15 seconds
  • Ensure you’re viewing the correct date range
  • Check if you’re filtering by specific dimensions
Common issues:
  • Verify your API key is correct and has the right permissions
  • Check that you’re including the Authorization header
  • Ensure your request body is valid JSON
  • Review the error message in the response

Get Help

Need assistance? We’re here to help:

Documentation

Browse our comprehensive guides

API Reference

Detailed API documentation

GitHub Discussions

Ask questions and share ideas

Discord Community

Chat with the team and community

Build docs developers (and LLMs) love