Menu

Require the agent to leave existing data-analytics attributes alone
📰

Require the agent to leave existing data-analytics attributes alone

DEV Community: frontend·Sherotree·2 days ago
#7NXon5SF
#devtofrontend#devto#dev#analytics#attribute
Long article (425 words) — no AI summary yet.
Reading 0:00
15s threshold

The PR restyles a checkout button. It also removes data-analytics="checkout-submit" and renames data-cta="upgrade" to data-cta="upgrade-button" “to be clearer.” Nothing in the UI tests fails. A week later the funnel report is empty, because the collector still looks for the old names.

I’ve started treating analytics and experiment attributes as a contract , the same way I treat test IDs. A visual change is not a tracking-plan change. If the ticket is not about analytics, those attributes stay.

Why the attributes disappear

The model sees data-* hooks as optional decoration. It will “clean up” anything that is not a class or a handler, or it will rename them to match the new component name. Unlike a broken test id, a missing data-analytics attribute often has no CI check. The damage is delayed and silent.

Renames are as bad as deletions. Downstream dashboards, GTM triggers, and experiment buckets are not in the repo.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.