Skip to content
Last updated: 2026-04-06
Reference

Platform Extensions

Extend Dxtra Tag Manager with custom events, the client-side analytics API, and programmatic configuration through the GraphQL API.

Client-Side Analytics API

The window.dxtraAnalytics object is available after the Tag Manager script loads. Use it to send custom events:

JavaScript
window.dxtraAnalytics.track('event_name', {
  key: 'value',
  another_key: 123
});

See Event Tracking for detailed usage and examples.

GraphQL API

Dxtra Tag Manager exposes a GraphQL API for programmatic management of applications, tags, rules, and environments. Access the API through your Dxtra platform authentication.

Authentication

API requests require a valid Dxtra platform token. Obtain tokens from your Dxtra dashboard.

Common Operations

The API supports:

  • Applications -- create, list, update application configurations
  • Tags and rules -- manage tag configurations programmatically
  • Revisions -- create, finalize, and deploy revisions
  • Environments -- configure and manage deployment environments
  • Global components -- manage global triggers and global actions

API documentation

Complete GraphQL API reference is available in the Tag Manager dashboard under API Access.

Custom Action Development

The 11 built-in action types cover most use cases. For custom behavior, use:

  • Inject Script -- run arbitrary JavaScript
  • Load JS / Load JS Direct -- load external scripts
  • Load HTML -- inject HTML content
  • Create Hidden Frame -- load content in an iframe

These actions let you integrate with any third-party service or implement custom business logic within the Tag Manager rule engine.

Webhook-Style Integration

To send Tag Manager event data to your own backend:

  1. Create a rule with the appropriate event trigger
  2. Add a Fire Pixel or Inject Script action
  3. In the script, send data to your endpoint:
JavaScript
// Example: send event data to your backend
fetch('https://your-api.example.com/events', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    event: '{{Event Name}}',
    page: '{{Page URL}}',
    timestamp: new Date().toISOString()
  })
});

Environment Variables in Extensions

Use environment variables to adapt behavior across environments:

JavaScript
const endpoint = '{{Environment.API_ENDPOINT}}';
const debug = '{{Environment.DEBUG_MODE}}' === 'true';

if (debug) {
  console.log('Sending to:', endpoint);
}

See Environments for configuring environment variables.

Best Practices

  • Use built-in action types first -- they handle error cases and integrate with the debug overlay
  • Gate third-party scripts on consent -- use CMP Check conditions before loading external code
  • Test in development environments -- use environment variables to avoid sending test data to production endpoints
  • Keep custom scripts small -- large inline scripts affect page performance

Continue to Environments for managing development, staging, and production environments.