DEV Community

Robin Beraud-Sudreau
Robin Beraud-Sudreau

Posted on

Instagram, instagram, ig: why your link tracking splits your numbers

You tag a link for your newsletter, another for your bio, a third for a partner post. Two weeks later your analytics lists "Instagram", "instagram" and "ig" as three sources. None looks big, and you can't tell which channel works.

The cause is small. Tracking tags (the utm_source=... part of a link) are plain text, and plain text gets typed differently each time. Capital letters, spaces, an underscore here and a hyphen there all count as different values.

I wrote a Hermes skill, utm-link-builder, to handle this. You give your agent the page, the channels and the campaign name. It writes a CSV, runs a short Python script (no install, no API key) and returns one clean link per channel. Everything is lowercase, spaces become hyphens, and existing parameters and #anchors are kept. Rows with a missing field or a duplicate are flagged.

It also works backwards: paste links you already published and it lists untagged ones and sources spelled several ways.

python3 scripts/utm_links.py build links.csv -o tagged.csv
Enter fullscreen mode Exit fullscreen mode

A row with source "Instagram", medium "Social" and campaign "Spring Launch" becomes ...?utm_source=instagram&utm_medium=social&utm_campaign=spring-launch.

It can't guess that "ig" means Instagram, so you still pick one name per channel. Some platforms rewrite links, so test one before a big launch.


Skill (MIT): https://github.com/RobinBeraud/hermes-skills/tree/main/marketing/utm-link-builder
All skills: https://github.com/RobinBeraud/hermes-skills

This post was written with AI assistance and reviewed through automated checks.

Top comments (0)