A website and its tracking are usually two separate things describing the same page. The website changes every week, because that is its job; the tracking is supposed to keep matching it. The further the tracking’s definition lives from the thing it measures, the more room there is for the two to drift apart without anyone noticing. There are three ways to define it, and they are three distances.
1
Pointing at the page
Spotting someone across the room by their red jacket.
In a tag manager, outside the website, someone writes a rule: when the element with the styling class hero-banner-v2 appears, count a banner view.
+ Marketing can add tracking without developers or releases.
− The class name is how the page happens to be built today. A redesign renames it and the rule points at nothing, silently.
2
The page announces it
A bulletin board the website writes on.
Developers add a line of code at the meaningful moments (dataLayer.push) that posts what happened; the tag manager listens.
+ Survives redesigns: the announcement is part of the page's code, reviewed like code. A respectable minimum.
− The noticing (was the banner really seen?) is hand-written per component, and nothing enforces names: bannerClick, banner_click and clickBanner all appear over the years.
3
A label on the thing itselfThis store
A name tag pinned on the person.
The banner carries its tracking in its own HTML: what it is, the facts about it, and which moment counts. A small library does all the watching and counting.
+ Nothing to drift: the label moves with the element. Label a component once and every copy tracks itself. One grammar, so one name per event.
− Tracking becomes engineering work: a change in code and a release, not a quick edit in a tool.