Extract UTM parameters
Turn campaign URLs into source, medium and campaign fields.
Original starter · no credentials · manual execution
The sample transformation is tested against the output below. Import and execution in your specific n8n version still need verification.
When to use it
Inspect campaign metadata before passing records to a spreadsheet or analytics system.
What is in the workflow?
- Manual Trigger: start a test deliberately.
- Sample data: synthetic rows in a Code node.
- Extract UTM parameters: a Code node with the transformation.
- Read first: a Sticky Note with setup and limitations.
Sample input
[
{
"url": "https://example.com/?utm_source=newsletter&utm_medium=email&utm_campaign=launch"
}
]Expected output
Explicit source, medium and campaign fields beside the original URL.
[
{
"url": "https://example.com/?utm_source=newsletter&utm_medium=email&utm_campaign=launch",
"utm_source": "newsletter",
"utm_medium": "email",
"utm_campaign": "launch"
}
]Import and adapt
- Download the JSON and use Import from File in your n8n editor.
- Review the Code nodes, then execute manually with the included sample.
- Compare the final output to the example above.
- Replace Sample data with your own source only after reviewing the input contract.
Before using real data
Only these three UTM keys are extracted. Malformed percent escapes fail explicitly; duplicate keys use the last value.
This template does not send messages or contact external services. Adding a source or destination changes its behavior; test the complete workflow in your instance.