Analytics Providers Overview
Configure multiple analytics providers to send events simultaneously to GTM, Facebook Pixel, RudderStack, and custom platforms.
Configure analytics providers to send events to multiple platforms. The SDK supports Google Tag Manager, Direct GA4 integration, Facebook Pixel, RudderStack, and custom webhooks.
Provider Configuration
Enable multiple providers in your configuration:
window.nextConfig = {
apiKey: 'your-api-key',
storeName: 'my-store', // Important for Facebook deduplication
analytics: {
enabled: true,
mode: 'auto',
providers: {
gtm: { enabled: true },
facebook: { enabled: true, settings: { pixelId: 'xxx' } },
rudderstack: { enabled: true },
custom: { enabled: true, settings: { endpoint: 'https://...' } }
}
}
};Providers Comparison
| Provider | Best For | Setup Complexity | Auto-Deduplication |
|---|---|---|---|
| Google Tag Manager | Event tracking & conversion measurement | Low | Yes (via GTM) |
| Direct GA4 (No GTM) | Simple GA4 tracking without GTM | Very Low | Yes (automatic) |
| Facebook Pixel | Conversion tracking & audience building | Medium | Yes (with storeName) |
| RudderStack | Data warehouse integration & CDP | High | Yes (via RudderStack) |
| Custom Webhook | Third-party integrations & APIs | Medium | Manual |
Provider Independence
Each provider operates independently. If one provider fails or is temporarily unavailable:
- Other providers continue to receive and process events normally
- Failed requests do not block the event pipeline
- Your analytics data is safely distributed across multiple platforms
- No single point of failure exists
Using Multiple Providers
You can enable any combination of providers simultaneously:
All Providers
Enable all providers for data collection across multiple platforms:
analytics: {
providers: {
gtm: { enabled: true },
facebook: { enabled: true, settings: { pixelId: 'YOUR_PIXEL_ID' } },
rudderstack: { enabled: true },
custom: { enabled: true, settings: { endpoint: 'https://your-api.com/events' } }
}
}Selective Providers
Choose only the providers you need:
analytics: {
providers: {
gtm: { enabled: true },
facebook: { enabled: true, settings: { pixelId: 'YOUR_PIXEL_ID' } },
rudderstack: { enabled: false },
custom: { enabled: false }
}
}Enable multiple providers to send analytics data to all required platforms. If one service fails, others continue operating.
Provider Setup Guides
Google Tag Manager
Container setup, variable configuration, and GTM trigger patterns.
Facebook Pixel
Conversion tracking, audience building, and server-side deduplication.
Direct GA4
Send events directly to Google Analytics 4 without Google Tag Manager.
RudderStack
Data warehouse and CDP integration — stream events to your data pipeline.
Custom Webhook
Send events to any third-party API or custom analytics endpoint.
Event Transformers
Build custom transformers for TikTok, Snapchat, Pinterest, and other platforms.
Custom Triggers
Modify when add_to_cart and begin_checkout events fire for advanced tracking.
Next Steps
- Choose which providers you need
- Follow the provider-specific setup guide
- Test event delivery in your development environment
- Deploy to production
Best Practices
Patterns and recommendations for implementing Campaign Cart analytics including configuration strategies, event naming conventions, tracking patterns, and optimization techniques.
Event Transformers
Build custom event transformers to convert NextDataLayer events to any platform's format.