Dxtra Tag Manager Technical Guide¶
Detailed technical documentation for implementing and managing tags, rules, events, and actions within Dxtra Tag Manager.
Core Concepts¶
Dxtra Tag Manager is built on an event-driven, rule-based engine where:
- Events trigger evaluation
- Conditions and Exceptions determine if rules should fire
- Actions execute when rules are satisfied
Events¶
Event Types¶
Platform Events (pre-defined):
- Page View -- Fires on page load
- Click Elements -- Tracks element clicks
- Form Submit -- Monitors form submissions
- Scroll Depth -- Tracks scroll percentage
- Time on Page -- Fires after specified duration
Custom Browser Events:
window.dispatchEvent(new CustomEvent('myCustomEvent', {
detail: { category: 'engagement', action: 'video-play' }
}));
CSS Selectors for Events¶
Events support CSS query selectors for element binding:
- ID selector:
#example-id - Class selector:
.example-class - Attribute selector:
[data-tracking="button-click"]
Event State Management¶
- Single Fire -- Events fire once per page by default
- Reset State -- Enable to reset event after specified milliseconds
- Persistent State -- Maintains state across page navigation in SPAs
Rules¶
Rule Structure¶
Rule Properties¶
- Execution Order -- Rules evaluate serially within Rule Groups. First matching rule wins unless repeatable.
- Repeatable Rules -- Enable rules to fire multiple times with configurable delay between executions.
Conditions (Must Match)¶
Test data layer values and page state:
Exceptions (Must NOT Match)¶
Prevent tag firing under specific circumstances:
Comparison Operators¶
- Equals -- Exact match
- Contains -- Substring match
- Matches RegEx -- Pattern matching
- Greater Than / Less Than -- Numeric comparisons
- Exists / Not Exists -- Presence checks
Rule Groups¶
Rule Groups provide:
- Parallel evaluation of multiple rules
- Logical organization of related rules
- Performance optimization through grouping
Actions¶
Action Types¶
-
Set Data Layer Variable
-
Send HTTP Request -- POST data to external endpoints
- Execute Custom JavaScript -- Run custom tracking logic
- Load External Script -- Dynamically load third-party scripts
Action Groups¶
Action Groups contain related actions that can be reused across multiple rules and support A/B testing through distributions.
Distributions (A/B Testing)¶
Distribution Types¶
- None -- All actions execute (100%)
- Page Load -- Random selection per page view
- Session -- Consistent selection per user session
Session-based distribution uses privacy-preserving identification (24-hour hash, no cookies, no personal information stored). Distribution values range from 1-1000.
Global Triggers and Actions¶
Global Triggers -- Reusable trigger combinations across multiple rules for standardizing common patterns.
Global Actions -- Shared actions for consistency across rules (error tracking, performance monitoring, consent updates, session management).
Single Page Applications¶
Handle client-side routing in SPAs:
Debugging¶
Debug Mode¶
// Enable debug mode
window.dxtraDebug = true;
// Enable verbose logging
window.dxtraVerbose = true;
Debug mode provides:
- Event monitoring as events fire
- Rule evaluation tracking
- Data layer inspection
- Action execution monitoring
- Performance metrics
Best Practices¶
Performance¶
- Minimize DOM queries -- cache element references
- Debounce scroll events
- Lazy load tags when possible
- Use rule priorities for efficient ordering
Privacy Compliance¶
- Check consent before firing tags
- Collect only necessary data
- Use privacy-preserving identifiers
- Implement data retention policies
Organization¶
- Use consistent, descriptive naming conventions
- Document complex rules and actions
- Use revisions for change management
- Test in preview mode before publishing
Error Handling¶
- Wrap custom JavaScript in try-catch blocks
- Implement fallback actions for failed requests
- Monitor and log failures
- Ensure graceful degradation
Troubleshooting¶
Tags Not Firing¶
- Check event bindings and CSS selectors
- Verify conditions are met
- Review consent state
- Inspect browser console for errors
Duplicate Tracking¶
- Check rule repeatability settings
- Review action group distributions
- Verify SPA route change handling
Performance Issues¶
- Optimize selector queries
- Reduce synchronous actions
- Review tag loading priorities
Related Documentation¶
- Tag Manager -- Overview and getting started
- Consent Management -- Consent integration
- API Reference -- Tag Manager API
For support, contact support@dxtra.ai with "Tag Manager" in the subject line.