Skip to content

Add UTM parameters to links pointing at ohdear.app - #152

Merged
freekmurze merged 1 commit into
mainfrom
utm-parameters-for-ohdear-links
Jul 28, 2026
Merged

freekmurze merged 1 commit into
mainfrom
utm-parameters-for-ohdear-links

Conversation

@freekmurze

Copy link
Copy Markdown
Member

Links to ohdear.app now carry UTM parameters so we can tell which channel drove the click. Tracked domains live in config/utm.php, so adding mailcoach.app or flareapp.io later is a one-line change.

Surface source medium campaign
Post page, listings, excerpts, RSS freek.dev referral blogpost-{id}-{slug}
Community links page freek.dev referral community-link-{id}-{slug}
Ads freek.dev banner ad-{id}
Videos freek.dev referral video-{id}-{slug}
Newsletter newsletter email freek-dev-issue-{n}
Tweet / toot / Bluesky twitter / mastodon / bluesky social blogpost-{id}-{slug}

Campaign identifies the content, source and medium identify the channel, so the same post is comparable across newsletter, social and the site.

UtmTagger tags at output time rather than baking parameters into the stored html column. That keeps the scheme changeable without re-rendering every post, and it needs no backfill. Existing query strings and fragments are preserved, and a URL that already carries a utm_source is left alone.

https://ohdear.app/docs?section=uptime#alerts
→ https://ohdear.app/docs?section=uptime&utm_source=freek.dev&utm_medium=referral&utm_campaign=blogpost-42-my-post#alerts

Canonical URLs, JSON-LD, og tags, the public API and Filament admin are deliberately left untagged.

Two things worth knowing:

  • The newsletter archive renders campaign HTML stored from Mailcoach, so clicks from /newsletter/archive/* are attributed to utm_medium=email rather than to the web page. Low volume, left as is.
  • Sponsor links pasted into Mailcoach after getMarkdown() runs are not swept.

194 tests pass.

Links to ohdear.app are now tagged so we can tell which channel drove the
click. The tracked domains live in config/utm.php.

Co-Authored-By: Claude <noreply@anthropic.com>
@freekmurze
freekmurze merged commit 38dc373 into main Jul 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant