Legacy Pixel Integration
The legacy MDB pixel enabled person-level website visitor identification. This documentation is maintained for existing implementations.Quick Start
Add the legacy MDB pixel to your website using your organization’s tracking ID:Parameters
TRACKING_ID- Your organization ID from the MDB dashboardoptions- A stringified JavaScript object with custom configuration
Implementation Examples
Basic Implementation
With Custom Options
Dashboard Setup
Before implementing the pixel, you’ll need to set up your MDB dashboard:- Log into your MDB dashboard
- Create a webhook callback URL where you want to receive person-level visitor identification data
- Copy your organization tracking ID for use in the pixel implementation
- Configure any additional settings as needed
Options Object
Theoptions parameter allows you to pass custom data that will be included in your webhook responses. This is useful for:
- Campaign tracking - Identify which campaigns are driving identified visitors
- Page categorization - Segment data by page type or content category
- User segmentation - Track different user types or segments
- Custom metadata - Include any additional context you need
Debug Mode
For troubleshooting pixel integration issues, you can enable debug mode by addingmdb_pixel_debug=true to your page URL:
- “mdb pixel loaded” - Pixel successfully initialized and loaded
- “mdb pixel error” - Pixel failed to load or initialize
Debug mode only affects console logging and doesn’t change pixel functionality. Remove the debug parameter for production use.
Best Practices
- Test thoroughly - Always test your pixel implementation in a development environment first
- Validate options - Ensure your options object is valid JSON before deployment
- Monitor performance - The pixel is designed to be lightweight, but monitor your site’s performance
- Use meaningful options - Include options that will be useful in your webhook processing
- Use debug mode - Enable debug mode during development to troubleshoot integration issues
Migrating to v1 Pixel
We recommend migrating to the v1 Pixel for improved reliability and performance:Key Differences
| Feature | Legacy Pixel | v1 Pixel |
|---|---|---|
| URL Format | https://p.mdb.tools/TRACKING_ID | https://p.mdb.tools/v1/PIXEL_ID |
| Identifier | Organization Tracking ID | Pixel ID |
| Reliability | Standard | Enhanced |
| Performance | Standard | Optimized |
Migration Steps
- Login to MDB dashboard at mdb.tools/dash
- Create a webhook if you haven’t already
- Create a new v1 pixel in your dashboard
- Update your script tag from:
To:
- Test thoroughly in a staging environment before deploying to production
Next Steps
Once you have the pixel implemented:- Consider migrating to v1 - Get improved reliability and performance
- Set up webhook handling - Configure your server to receive and process webhooks
- Understand billing - Learn how MDB’s credit system works