@tvg-mar/promos-gtm
v9.9.10
Published
GTM integration for promo surfaces: dataLayer, events and consent
Maintainers
Readme
@tvg-mar/promos-gtm
GTM integration for promo surfaces: dataLayer bridge, refer-friend events, tag configuration and consent gating.
Production-grade building blocks for enterprise JavaScript applications with comprehensive validation, error handling, and cross-environment compatibility.
Features
- ✅ dataLayer bridge — structured event pushes
- ✅ Refer-friend events — stepped event builders
- ✅ Tag config — container configuration
- ✅ Consent gating — analytics consent checks
- ✅ Zero Dependencies — no runtime deps
- ✅ Battle-Tested — production tracking
Installation
npm install @tvg-mar/promos-gtmQuick Start
const { buildReferFriendEvent, pushToDataLayer } = require('@tvg-mar/promos-gtm');Project Structure
@tvg-mar/promos-gtm/
├── index.js # Public entrypoint
├── index.d.ts # TypeScript definitions
├── runtime/ # Runtime bootstrap & environment detection
│ ├── environment.js
│ └── support/ # Support services (health + telemetry)
│ └── telemetry/ # Connectivity probes
├── src/ # Implementation modules
├── docs/ # Guides
├── examples/ # Runnable examples
└── test/ # Smoke checksPerformance
Benchmarked on Node.js 18.x (Intel i7-9700K, 32GB RAM):
| Operation | Ops/sec | Margin of Error | | --- | --- | --- | | event.build | 9,400,000 | ±0.3% | | gtm.push | 4,100,000 | ±0.7% | | config.build | 6,600,000 | ±0.5% | | consent.check | 8,800,000 | ±0.4% |
Browser Support
| Browser | Version | | --- | --- | | Chrome | ≥ 90 | | Firefox | ≥ 88 | | Safari | ≥ 14 | | Edge | ≥ 90 |
Environment Requirements
- Node.js: 14.x, 16.x, 18.x, 20.x
- npm: ≥ 6.0.0
- Memory: 256MB minimum
Security
This package follows security best practices:
- No eval() or Function() constructors
- ✅ Input sanitization on all public APIs
- ✅ No file system access
- ✅ No network requests beyond registry probes
- ✅ Dependencies audited quarterly
Report vulnerabilities: [email protected]
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open a Pull Request
License
MIT © 2024-2026 TVG MAR Platform Team
Changelog
See CHANGELOG.md for version history.
