What is Link Shortening?
Link shortening converts long URLs into shorter, more shareable links:- Short URLs:
dby.cc/summer-saleinstead ofexample.com/products/seasonal/summer-2024/sale?utm_source=email - Click tracking: Monitor link performance with analytics
- Device targeting: Send mobile users to app stores, desktop users to web
- Social previews: Custom Open Graph images and descriptions
- Expiration: Set time-limited links for campaigns
Creating Short Links
Via Dashboard
- Navigate to Links in the sidebar
- Click Create Link
- Enter the target URL
- Configure link options (slug, expiration, etc.)
- Click Create
Link Fields
| Field | Description | Required |
|---|---|---|
| Name | Internal identifier for the link | Yes |
| Target URL | Destination URL | Yes |
| Slug | Custom short code (auto-generated if empty) | No |
| Expires At | Link expiration date/time | No |
| Expired Redirect URL | Where to send users after expiration | No |
Example: Campaign Link
dby.cc/bf24 that expires on November 30, 2024.
Custom Slugs
Auto-Generated Slugs
Leave slug empty for automatic generation:- Format: Random alphanumeric string (6-8 characters)
- Example:
dby.cc/a3kF9x - Collision-resistant using hash-based generation
Custom Slugs
Define memorable short codes:- Use lowercase letters, numbers, hyphens
- Length: 3-50 characters
- Must be unique across your organization
- Examples:
summer-sale,signup,docs
Device Targeting
Send users to different URLs based on their device:iOS Targeting
Redirect iOS users to App Store:Android Targeting
Redirect Android users to Play Store:Combined Targeting
- iOS users → App Store
- Android users → Play Store
- Desktop/other → Web URL
Open Graph Metadata
Customize how links appear when shared on social media:OG Fields
| Field | Description | Recommended Size |
|---|---|---|
| OG Title | Preview title | 60-90 characters |
| OG Description | Preview description | 150-200 characters |
| OG Image URL | Preview image | 1200×630 pixels |
| OG Video URL | Preview video | MP4 or YouTube URL |
Example: Social Preview
Social bots (Twitter, Facebook, etc.) are automatically shown an Open Graph preview page instead of being redirected.
Link Expiration
Setting Expiration
Links can expire automatically:expiredRedirectUrl or a default expiration page.
Expired Redirect URL
Customize where expired links redirect:https://app.databuddy.cc/dby/expired.
Use Cases
- Limited-time offers: Automatically disable after promotion ends
- Event links: Expire after event date
- Beta access: Time-limited signup links
- Seasonal campaigns: Auto-expire outdated campaigns
Click Tracking
Automatic Analytics
Every link click is tracked with:- Timestamp
- Referrer (where the click came from)
- User agent (browser and device)
- Geographic location (country, region, city)
- Browser name
- Device type (desktop, mobile, tablet)
Privacy-First Tracking
- IP addresses are hashed (SHA-256) before storage
- No personal identifiable information collected
- Anonymous visitor identification
- GDPR compliant
Deduplication
Clicks from the same user are rate-limited:- Uses IP hash for deduplication
- Prevents click spam
- Tracks unique clicks accurately
Bot traffic is automatically filtered using user agent detection.
Link Analytics
Viewing Link Performance
- Navigate to Links
- Click on a link to view details
- See click metrics, referrers, devices, and locations
Available Metrics
- Total Clicks: All-time click count
- Unique Visitors: Distinct users who clicked
- Referrer Breakdown: Where clicks originated
- Geographic Distribution: Clicks by country/region
- Device Types: Desktop vs. mobile vs. tablet
- Browser Distribution: Which browsers users use
- Click Trends: Clicks over time (hourly, daily, weekly)
Exporting Data
Export link analytics:- Open link details
- Click Export
- Choose format (CSV or JSON)
- Download analytics data
Managing Links
Editing Links
- Click a link from the links list
- Click Edit
- Modify any field (name, target URL, slug, expiration, etc.)
- Click Save
Deleting Links
Permanently remove a link:- Open the link’s detail page
- Click Delete
- Confirm deletion
- Stop redirecting (404 Not Found)
- Retain analytics data (unless purged)
- Cannot be recovered
Bulk Operations
Manage multiple links at once:- Select links using checkboxes
- Choose bulk action (delete, export, etc.)
- Confirm operation
Advanced Features
Caching
Link data is cached for performance:- Redis cache: Link metadata cached in-memory
- TTL: Cache invalidates on updates
- ETag support: Browser-level caching for repeated clicks
Rate Limiting
API rate limits protect against abuse:- 100 requests per minute per IP
- Returns
429 Too Many Requestswhen exceeded - Rate limit headers included in responses
Bot Detection
Automatic bot filtering:- Social media crawlers (Twitter, Facebook) → OG preview
- Search engine bots → Direct redirect (no tracking)
- Malicious bots → Filtered from analytics
ua-parser-js library.
Link Infrastructure
Databuddy’s link service is built for scale:- Runtime: Bun + Elysia (ultra-fast HTTP server)
- Database: PostgreSQL (via Drizzle ORM)
- Cache: Redis (link metadata)
- Analytics: Kafka + ClickHouse (click events)
- Observability: OpenTelemetry tracing to Axiom
- Geographic data: MaxMind GeoIP2
High Availability
- Graceful shutdown (SIGTERM/SIGINT)
- Connection pooling
- Automatic retries
- Health check endpoint (
/health)
Best Practices
Naming Conventions
Use descriptive internal names:- Good: “Summer 2024 Email Campaign”
- Bad: “Link 1”
Slug Strategy
- Campaigns: Use branded slugs (
summer-sale,webinar) - Temporary: Use auto-generated slugs
- Evergreen: Use descriptive slugs (
docs,support,pricing)
OG Optimization
- Title: Front-load key words, 60-90 characters
- Description: Compelling preview, 150-200 characters
- Image: High-quality, 1200×630 pixels, < 1MB
- Test: Use Twitter Card Validator, Facebook Debugger
Expiration Strategy
- Set expiration for time-sensitive campaigns
- Always provide
expiredRedirectUrlfor better UX - Review expired links monthly and delete unused ones
Monitor Performance
- Track click-through rates
- Compare referrer performance
- Analyze device targeting effectiveness
- A/B test OG metadata
Security
URL Validation
Target URLs must:- Use
http://orhttps://protocol - Be valid, reachable URLs
- Not redirect to localhost (in production)
Slug Constraints
- 3-50 characters
- Alphanumeric + hyphens only
- No reserved words (
admin,api,health, etc.) - Case-insensitive uniqueness
Rate Limiting
Per-IP rate limits prevent:- Click fraud
- DDoS attacks
- Analytics pollution
Integration with AI
Use the AI assistant to manage links: Example queries:- “Show me all my short links”
- “Create a link for the summer sale”
- “What’s the performance of the bf24 link?”
- “Delete expired links”
Next Steps
Analytics
Analyze link click data
Goals
Track link conversion goals
AI Insights
Ask the AI about link performance
API Reference
Programmatic link management