Every tracking setup starts with a choice that quietly shapes the next three years: put a tag manager in charge, or hardcode tags straight into the site. It looks like a technical detail and is really about who can change measurement and how fast. Here is how they compare.
What each approach means
Hardcoding means placing each vendor's snippet directly in your site's source, so changing tracking means changing and redeploying code. A tag manager like GTM instead loads one container, and all your tags, triggers, and rules live inside it, editable without touching the site. The difference is where control sits: in the codebase, or in a management layer on top of it.
Point by point
The trade-offs line up across what matters day to day:
- Who can change tags – hardcoded needs a developer and a deploy; GTM lets marketers and analysts change tags themselves.
- Speed of change – hardcoded moves at your release cycle; GTM changes go live in minutes.
- Performance – hardcoded can be leaner if disciplined; GTM adds a container but manages loading for you.
- Governance – hardcoded changes sit in version control; GTM has its own versioning and preview.
- Risk – hardcoded errors need a hotfix deploy; GTM mistakes are a one-click rollback.
Where GTM clearly wins
For most organizations GTM is the right default, because it decouples measurement from the release cycle. Marketing can launch a campaign tag, fix a trigger, or add a conversion without waiting weeks for engineering, and a mistake is a rollback rather than an incident. That agility, plus built-in preview, versioning, and a library of vendor templates, is why tag managers became standard practice.
Where hardcoding still makes sense
Hardcoding is not obsolete, and in specific cases it is the better call. A critical measurement that must never be blocked or altered, a highly performance-sensitive page where every kilobyte counts, or an engineering-led team that prefers everything in version control can all justify putting tags in code. The most important conversions are sometimes hardcoded precisely so they do not depend on a container loading.
The common reality is both
In practice mature setups rarely choose purely one or the other. Core, mission-critical tracking may be hardcoded or sent server-side for reliability, while the long tail of marketing and campaign tags lives in GTM for agility. Framing it as which tags belong in code and which belong in the manager, rather than one global winner, is how experienced teams actually run it.
The cost is front-loaded, the agility is forever
People compare the two as if the effort were equal, but the costs fall at different times. Hardcoding feels cheap on day one and then taxes you on every change forever, because each new tag is another developer ticket and deploy. GTM asks for a little setup up front – the container, the data layer, some governance – and then changes are nearly free for years. Judged over the life of a site rather than the first week, the manager's small upfront cost buys a large, compounding saving in how fast measurement can move.
A quick way to decide
If you are unsure for a given tag, these questions settle it:
- Will non-developers need to change it often? That points to GTM.
- Must it never be blocked or altered, like a critical purchase conversion? That argues for hardcoding or server-side.
- Is it a short-lived campaign or experiment tag? GTM, every time, so it can be added and removed without a deploy.
Answer those for each tag rather than for the whole site, and the mix usually sorts itself: the vast majority of marketing tags land in GTM, while a small, important handful stay in code or move server-side.
The choice between a tag manager and hardcoded tags is really a choice about who controls measurement and how quickly it can change. GTM wins for agility, safety, and self-serve change, which fits most teams, while hardcoding earns its place for the few tags that must be lean or unbreakable. Decide per tag against those needs, and you get both the speed of a manager and the reliability of code where each actually matters.
Want a stronger data analyst role or a raise? Grab the FREE Product Analyst Playbook and get the exact roadmap to your next offer.
