This is an absolute war story, and it highlights a massive operational blind spot that doesn't just plague solo founders, but completely paralyzes enterprise Developer Relations (DevRel) teams: The Attribution Gap.
You've beautifully diagnosed the technical nightmare here. If your GTM data layers aren't perfectly aligned, or if a single UTM parameter gets dropped during a client-side redirect or a router change, your entire marketing pipeline suffers from data amnesia. You see a conversion, but its ancestral lineage is completely wiped out.
In the DevRel and Developer Marketing space, this problem is amplified by 10x because developers have a notoriously non-linear journey. They don't click a LinkedIn ad and immediately buy an enterprise license. They read a technical blog post, drop a link in a private Slack or Discord, spin up an open-source sandbox repo weeks later, and eventually convert from a corporate corporate network that has zero historical cookies associated with their initial discovery.
Your focus on getting the database schema right—ensuring those UTM columns exist as first-class citizens in your user tables rather than relying purely on volatile front-end analytics scripts—is the exact right engineering fix.
To take this a step further: once you have those static UTM columns locked down, how are you planning to handle Multi-Touch Attribution? If a user touches a GitHub repo (Organic), reads a documentation page (Direct), and then clicks a launch announcement tweet (Organic Social) before finally creating an account, are you defaulting to a naive Last-Touch model, or are you building a custom ingestion pipeline to preserve that entire discovery topology?