Idlen Logo
Api

API Reference

Complete API reference for the Idlen Pixel SDK

API Reference

This page is a quick command reference. For complete option matrices and payload schema, see Events Reference.

Commands

idlen('init', advertiserId, options?)

Initialize the pixel with your advertiser ID.

// Basic
idlen('init', 'adv_abc123');

// With options
idlen('init', 'adv_abc123', { debug: true });
ParameterTypeRequiredDescription
advertiserIdstringYesYour advertiser ID from Ads Manager
options.debugbooleanNoEnable console logging
options.autoTrackbooleanNoAuto-track URL changes
options.trackHashbooleanNoTrack hash-based route changes
options.excludeRoutesstring[]NoRoutes excluded from tracking
options.endpointstringNoCustom API endpoint

idlen('track', 'PageView')

Track a page view event.

idlen('track', 'PageView');

idlen('track', 'Conversion', data?)

Track a conversion event.

// Simple conversion
idlen('track', 'Conversion');

// Named conversion
idlen('track', 'Conversion', { eventName: 'signup' });

// Conversion with value
idlen('track', 'Conversion', { 
  eventName: 'purchase', 
  value: 99.99 
});
ParameterTypeRequiredDescription
data.eventNamestringNoCustom event name
data.valuenumberNoMonetary value

idlen('track', 'CustomEventName', data?)

Track custom interactions with any event name.

idlen('track', 'FeatureUsed', {
  feature: 'export',
  format: 'csv'
});

Event Payload

Events sent to the API include:

FieldTypeDescription
aidstringAdvertiser ID
vidstringVisitor ID (UUID)
etstringEvent type (pageview, conversion)
enstring?Event name (for conversions)
evnumber?Event value (for conversions)
urlstringPage pathname
refstring?Referrer domain
tsnumberTimestamp (milliseconds)

TypeScript Types

interface IdlenOptions {
  debug?: boolean;
  autoTrack?: boolean;
  trackHash?: boolean;
  excludeRoutes?: string[];
  endpoint?: string;
}

interface ConversionData {
  eventName?: string;
  value?: number;
}

interface IdlenPixel {
  (command: 'init', advertiserId: string, options?: IdlenOptions): void;
  (command: 'track', eventType: 'PageView'): void;
  (command: 'track', eventType: 'Conversion', data?: ConversionData): void;
  (command: 'track', eventType: string, data?: Record<string, unknown>): void;
  q?: any[];
}

declare global {
  interface Window {
    idlen?: IdlenPixel;
  }
}

Network

Endpoint: POST https://pixel.idlen.io/v1/track

Method: Uses navigator.sendBeacon() with fallback to fetch()

Rate Limits: 100 requests/minute per IP

Response: 1x1 transparent GIF (for compatibility)

See Events Reference for full event schema and limits.

Copyright © 2026