Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2universalStack: javascript
analyticstrackingcorrectness
Give each module its own analytics category/action, not a copied one
Don't reuse another module's tracking category; set distinct, accurate analytics identifiers so events are attributable.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | // 'Nyttig' module wrongly emits the news module's category |
| 2 | <div data-ga-category='riksnyheter'> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <div data-ga-category='nyttig'> |
Explanation (EN)
Objašnjenje (HR)