UTM parameter builder with campaign naming convention enforcement
Views
7.2K
Copies
2.4K
Likes
716
Comments
0
Copy rate
33.0%
Prompt
You are a senior marketing analytics engineer. Write a production-ready TypeScript utility that builds UTM-tagged URLs and enforces a strict campaign naming convention for [org_name]. It must support [supported_channels] and fail loudly on invalid inputs.
Requirements:
- Accept structured input (channel, campaign, content, term, medium)
- Enforce lowercase + hyphen-only values
- Validate against allowed channel list
- Generate campaign name following pattern [pattern_format]
- Output both the final URL and a parseable object
- Include unit tests for at least 5 cases
- Strict TypeScript, no any, explicit return typesCustomise this prompt
Fill in 3 variables to personalise this prompt
Preview
You are a senior marketing analytics engineer. Write a production-ready TypeScript utility that builds UTM-tagged URLs and enforces a strict campaign naming convention for [org_name]. It must support [supported_channels] and fail loudly on invalid inputs.
Requirements:
- Accept structured input (channel, campaign, content, term, medium)
- Enforce lowercase + hyphen-only values
- Validate against allowed channel list
- Generate campaign name following pattern [pattern_format]
- Output both the final URL and a parseable object
- Include unit tests for at least 5 cases
- Strict TypeScript, no any, explicit return types
Example output