A powerful, self-hosted URL shortening and UTM campaign management solution for Frappe/ERPNext. Track marketing campaigns, analyze traffic sources, and optimize conversions with enterprise-grade analytics.
- Custom Branded Domains: Use your own domain for short URLs
- Flexible Short Codes: Auto-generated or custom aliases
- Bulk Operations: Create hundreds of URLs at once
- QR Code Generation: Automatic QR codes for every URL
- URL Expiration: Set time limits for temporary campaigns
- Full UTM Support: Source, Medium, Campaign, Term, Content
- Campaign Organization: Group URLs by marketing campaigns
- Template System: Reusable UTM parameter sets
- Multi-channel Tracking: Track performance across all channels
- Real-time Analytics: See clicks as they happen
- Conversion Source Tracking: Know where your traffic comes from
- Geographic Analytics: Track visitor locations
- Device & Browser Stats: Understand your audience
- Campaign ROI: Measure campaign effectiveness
- Self-hosted: Complete control over your data
- Rate Limiting: Prevent abuse and spam
- Permission Control: Role-based access
- API Access: Full REST API for integrations
- Scheduled Cleanup: Automatic maintenance
- Frappe/ERPNext v14 or higher
- Python 3.8+
- MariaDB/MySQL
- Redis
Install directly from the Frappe Cloud marketplace - no server configuration needed!
See FRAPPE_CLOUD_SETUP.md for detailed instructions.
# Install the app
bench get-app https://github.com/chinmaybhatk/utm_shortener.git
bench --site your-site-name install-app utm_shortener
# Run migrations
bench --site your-site-name migrate
For production deployment, see DEPLOYMENT.md.
Go to UTM Shortener Settings and configure:
Short Domain: your-site.frappe.cloud
Use HTTPS: ✓
Custom Domain Enabled: ☐
Short Domain: link.yourdomain.com
Use HTTPS: ✓
Custom Domain Enabled: ✓
# Create a campaign
campaign = frappe.get_doc({
"doctype": "UTM Campaign",
"campaign_name": "Product Launch 2024",
"utm_source": "social",
"utm_medium": "post",
"utm_campaign": "product-launch-2024"
}).insert()
# Create a short URL
short_url = frappe.get_doc({
"doctype": "Short URL",
"original_url": "https://example.com/new-product",
"utm_campaign": campaign.name,
"custom_alias": "new-product"
}).insert()
print(f"Your short URL: {short_url.short_url}")
https://your-site.frappe.cloud/s/new-product
https://link.yourdomain.com/s/new-product
https://short.link/new-product
graph LR
A[Create Campaign] --> B[Generate Short URLs]
B --> C[Share in Marketing]
C --> D[Visitor Clicks]
D --> E[Track Analytics]
E --> F[Redirect to Target]
E --> G[Dashboard Reports]
- No server management
- Automatic SSL
- Built-in scaling
- Works out of the box
- Full control
- Custom nginx configuration
- Any domain structure
- Use Cloudflare Workers for custom domains
- Keep app on Frappe Cloud
- Best of both worlds
See our Cloudflare Worker example for custom domain setup.
- Setup Guide - Detailed setup instructions
- Frappe Cloud Setup - Frappe Cloud specific guide
- Deployment Guide - Self-hosted production deployment
- Workflow Documentation - Visual workflow diagrams
- API Reference - Complete API documentation
All API calls require authentication using API keys or session tokens.
POST /api/method/utm_shortener.utm_shortener.api.create_utm_campaign
{
"campaign_name": "Summer Sale",
"utm_source": "email",
"utm_medium": "newsletter",
"utm_campaign": "summer-sale-2024"
}
POST /api/method/utm_shortener.utm_shortener.api.create_short_url
{
"original_url": "https://example.com/page",
"utm_campaign": "campaign-id",
"custom_alias": "summer"
}
GET /api/method/utm_shortener.utm_shortener.api.get_campaign_analytics
{
"campaign_id": "campaign-id"
}
- Track campaign performance across channels
- A/B test different messaging
- Measure ROI by traffic source
- Create personalized links for prospects
- Track engagement with sales materials
- Measure email campaign effectiveness
- Track viral content spread
- Measure influencer campaign impact
- Optimize posting strategies
- Track registration sources
- Measure promotional effectiveness
- Analyze attendee demographics
- Self-hosted: Your data stays on your servers
- Permission-based: Granular access control
- GDPR Compliant: Full data ownership and control
- Rate Limiting: Built-in abuse prevention
- Audit Trail: Complete activity logging
Track comprehensive metrics:
- Traffic Sources: Social, Search, Email, Direct
- Geographic Distribution: Country-level tracking
- Device Analytics: Desktop, Mobile, Tablet
- Time Analysis: Peak traffic hours
- Conversion Tracking: Source to conversion mapping
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on the robust Frappe Framework
- Inspired by modern URL shorteners like Bitly and Rebrandly
- Community contributors and testers
- Documentation: All Guides
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Frappe Cloud Support: support@frappe.cloud
Made with ❤️ for the Frappe/ERPNext community