Skip to main content

Legacy Pixel Integration

Legacy Version - This documentation covers the original pixel implementation. For new integrations, please use the v1 Pixel which offers improved reliability and performance.
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:
<script src="https://p.mdb.tools/TRACKING_ID?options={}"></script>

Parameters

  • TRACKING_ID - Your organization ID from the MDB dashboard
  • options - A stringified JavaScript object with custom configuration

Implementation Examples

Basic Implementation

<script src="https://p.mdb.tools/org_abc123?options={}"></script>

With Custom Options

<script src="https://p.mdb.tools/org_abc123?options={\"source\":\"homepage\",\"campaign\":\"summer2024\"}"></script>

Dashboard Setup

Before implementing the pixel, you’ll need to set up your MDB dashboard:
  1. Log into your MDB dashboard
  2. Create a webhook callback URL where you want to receive person-level visitor identification data
  3. Copy your organization tracking ID for use in the pixel implementation
  4. Configure any additional settings as needed

Options Object

The options 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
The options object must be properly JSON stringified and URL encoded when included in the script src.

Debug Mode

For troubleshooting pixel integration issues, you can enable debug mode by adding mdb_pixel_debug=true to your page URL:
https://yoursite.com/page?mdb_pixel_debug=true
When debug mode is enabled, the pixel will log status messages to the browser console:
  • “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

FeatureLegacy Pixelv1 Pixel
URL Formathttps://p.mdb.tools/TRACKING_IDhttps://p.mdb.tools/v1/PIXEL_ID
IdentifierOrganization Tracking IDPixel ID
ReliabilityStandardEnhanced
PerformanceStandardOptimized

Migration Steps

  1. Login to MDB dashboard at mdb.tools/dash
  2. Create a webhook if you haven’t already
  3. Create a new v1 pixel in your dashboard
  4. Update your script tag from:
    <script src="https://p.mdb.tools/org_abc123?options={}"></script>
    
    To:
    <script src="https://p.mdb.tools/v1/pixel_abc123?options={}"></script>
    
  5. Test thoroughly in a staging environment before deploying to production

Next Steps

Once you have the pixel implemented:
  1. Consider migrating to v1 - Get improved reliability and performance
  2. Set up webhook handling - Configure your server to receive and process webhooks
  3. Understand billing - Learn how MDB’s credit system works