Partner Tag

Demandbase Partner Tag Integration Guide

Overview

The DemandbasePartnerTag UMD module provides a minimal, secure API for partner integrations. It supports flat, top-level configuration keys (case-insensitive) and exposes a single public method: window.DemandbasePartnerTag.fire()

An auth key is required for the tag to function.


Key Features

Global Namespace

  • Exposed globally as window.DemandbasePartnerTag
  • Contains the auth key, configuration, and public API.

Example

<script>
     window.DemandbasePartnerTag = {
       auth: "YOUR_PARTNER_KEY_HERE",
       config: { enableLR: true, enableIX: true }
     };
   </script>
   <script src="https://tag.demandbase.com/partnertag.min.js" async></script>
   <script>
     window.DemandbasePartnerTag.fire();
   </script>


  1. Auth Key
    • Required and must be a top-level property
    • Must be set before the script loads.
    • Cannot be passed as a script attribute or within config
    • Configuration
      • All features (advertising + emailDomainReporter) are enabled by default
      • Supported Keys (case insensitive): enableLR enableIX enableMCTV enableRP enableSmartPixel enableEmailDomainReporter

Rules / Defaults


  • SmartPixel, emailDomainReporter, and all advertising features are enabled by default
  • If ANY advertising config (LR/IX/MCTV/RP) is provided -> others default to OFF (except SmartPixel + emailDomainReporter)
  • If enableSmartPixel: false -> ALL advertising features (including SmartPixel) are disabled, regardless of other configurations
  • If enableEmailDomainReporter: false -> ONLY emailDomainReporter is disabled
  • Any nested or unsupported keys are ignored

Configuration Methods


  • Via script tag
    • Via window.DemandbasePartnerTag.config

    • <script async src="https://tag.demandbase.com/partnertag.min.js"
          data-enable-lr="true"
          data-enable-mctv="true"
          data-enable-email-domain-reporter="false">
        </script>

Precedence

window.DemandbasePartnerTag.config

  • Script data-* attributes
  • Defaults
  • BEST PRACTICE: Use only data-* attributes for HTML compatibility

Initialization & API

Auto-initializes on load

  • Exposes ONLY the fire() method:
  • window.DemandbasePartnerTag.fire();
  • Returns a Promise resoloving to the raw IP API response
  • Dynamic Example

    • window.DemandbasePartnerTag = {auth: "YOUR_KEY", config: {enableLR: true}};
        const s = document.createElement('script');
        s.src = "https://tag.demandbase.com/partnertag.min.js";
        s.async = true;
        document.head.appendChild(s);
        s.onload = () => window.DemandbasePartnerTag.fire().then(console.log);

Dynamic Script Loading


You can also dynamically load the partner tag script and configure it programmatically.

// 1. Set up the global config before loading the tag
   window.DemandbasePartnerTag = {
     auth: "YOUR_PARTNER_KEY_HERE",
     config: {
       enableIX: true,
       enableLR: true
       // ...other config options...
     }
   };

// 2. Dynamically load the partner tag script with data-* attributes
   var script = document.createElement('script');
   script.src = "https://tag.demandbase.com/partnertag.min.js"; 
   script.async = true;
   // You can also set attributes here for configuration if desired
   // script.setAttribute('data-enable-lr', 'true');
   document.head.appendChild(script);

// 3. Optionally, trigger the tag after it loads
   script.onload = function() {
     if (window.DemandbasePartnerTag && typeof window.DemandbasePartnerTag.fire === 'function') {
       window.DemandbasePartnerTag.fire().then(response => {
         // response is the raw IP API JSON object
         console.log(response)
         return response
       });
     }
   };

Safety and Best Practices

The internal instance and class are not exposed

  • Users cannot manipulate internals or reconfigure after initialization
  • Only configuration before the script is loaded and the fire() method is triggered are supported
  • If the auth key is not provided, the tag will fail to initialize and throw an error
  • Providing the auth key as a script tag attribute or inside the config will NOT work

Additional Resources