Analytics Integration¶
Dxtra Tag Manager can work alongside third-party analytics platforms. Use the rule engine to control when and how data is sent to external services while respecting visitor consent.
Approach¶
Dxtra's built-in analytics runs automatically and requires no additional configuration. Third-party analytics platforms (Google Analytics, Facebook Pixel, etc.) are integrated through Tag Manager rules and actions:
- Create a rule that fires on the desired event (e.g., Page View)
- Add a consent condition to check the visitor has granted analytics or marketing consent
- Add an action that loads the third-party script and sends data
This pattern ensures third-party tracking only runs when the visitor has provided appropriate consent.
Common Integrations¶
Google Analytics 4¶
To send page views and events to GA4:
- Create a rule with the Page View event
- Add a condition:
CMP.analyticsequalstrue - Add a Load JS action to load the GA4 script (
https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX) - Add a Load JS Direct action to initialize GA4:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
For custom events, create additional rules that fire Inject Script actions with gtag('event', ...) calls.
Facebook Pixel¶
- Create a rule with the Page View event
- Add a condition:
CMP.marketingequalstrue - Add a Load JS action to load the Facebook SDK
- Add a Load JS Direct action to initialize:
Other Platforms¶
The same pattern works for any analytics or marketing platform:
- Load the platform's script using Load JS
- Initialize and configure using Inject Script or Load JS Direct
- Gate execution behind the appropriate consent condition
Consent-Aware Tracking¶
Always check consent before sending data to third-party platforms:
| Consent Category | Platforms | Legal Basis |
|---|---|---|
analytics | Google Analytics, Adobe Analytics, Mixpanel | Consent or legitimate interest |
marketing | Facebook Pixel, Google Ads, LinkedIn Insight | Consent required |
functional | Chat widgets, personalization tools | Consent or legitimate interest |
Use rule conditions to check CMP.analytics, CMP.marketing, or CMP.functional before firing third-party tags.
Dxtra's built-in analytics does not require consent conditions -- it is privacy-compliant by design.
Dual Tracking¶
You can track events in both Dxtra analytics and a third-party platform simultaneously. Use a rule with two actions:
- A Track Event action for Dxtra analytics (fires without consent gate)
- An Inject Script action for the third-party platform (gated by consent condition)
This ensures you always have privacy-compliant analytics data in Dxtra, with richer third-party data available when consent is granted.
Best Practices¶
- Always gate third-party scripts behind consent conditions to comply with GDPR/CCPA
- Use Dxtra analytics as your baseline -- it works without consent and provides core metrics
- Load third-party scripts asynchronously to avoid blocking page rendering
- Test integrations in a development environment before publishing to production
- Monitor the debug overlay to verify scripts load and events fire correctly
Continue to Consent Integration for detailed consent management integration.