
UTM Campaign URL
Builds UTM-parameterized URLs from base URLs and campaign details, and validates existing UTM tags for correctness. Developers integrate this into scripts or apps to generate trackable links for Google Analytics or similar tools. Applies to email campaigns, social media links, and A/B testing setups without external dependencies.
Overview
This MCP server implements a UTM campaign URL builder and validator designed for developers. It handles construction of URLs with standard UTM parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content) and verification of tagged URLs, all processed locally without external APIs. This ensures reliable, dependency-free tracking link generation for analytics platforms like Google Analytics.
Key Capabilities
-
build_utm_url: Takes a base URL and dictionary of UTM parameters, appends them as query strings following standard conventions, and returns the complete trackable URL. Supports optional encoding for special characters.
-
validate_utm_url: Parses an input URL, extracts UTM parameters, checks for required formats (e.g., no invalid characters in utm_campaign), and returns a validation report with errors or confirmed parameters.
These functions operate on strings, enabling seamless integration into Python scripts, web backends, or automation pipelines.
Use Cases
-
Email Campaign Automation: In a newsletter script, call build_utm_url with base='https://example.com/product', utm_medium='email', utm_campaign='summer-sale' to produce 'https://example.com/product?utm_medium=email&utm_campaign=summer-sale', then send via SMTP.
-
Social Media Link Generation: Build dynamic links for posts using build_utm_url with utm_source='twitter', utm_content='promo-post-1', integrating into a content management system.
-
Analytics Data Cleaning: Process inbound webhooks with validate_utm_url to filter invalid UTM tags before inserting into a database for reporting.
-
A/B Testing Setup: Generate variant URLs like utm_content='variant-a' vs 'variant-b' via build_utm_url for split testing in ad platforms.
Who This Is For
Developers building marketing automation tools, web analytics pipelines, or content platforms. Suited for backend engineers handling campaign tracking, growth hackers scripting link generation, and teams avoiding third-party UTM builders for privacy or reliability reasons.