Playout Tracking

Playout tracking allows you to confirm when advertisements have been successfully displayed on your screens. This is essential for accurate reporting, billing, and advertiser verification in programmatic DOOH advertising.

What is playout tracking?

After you accept an offer and receive a deal_id, your screen displays the advertisement. Once the ad has finished playing, you should call the playout confirmation endpoint to:

  • Confirm successful display - Verify the ad was actually shown
  • Enable accurate reporting - Track real impressions vs. deals
  • Ensure proper billing - Publishers get credited for confirmed playouts
  • Provide advertiser transparency - Proof of performance

Integration Flow: Request Offer → Accept Offer → Display Ad → Confirm Playout


The playout confirmation model

The playout confirmation request allows you to provide detailed information about how the advertisement was displayed.

Properties

  • Name
    played_at
    Type
    timestamp
    Description

    Optional. When the ad started playing (ISO 8601 format). Defaults to current time if not provided.

  • Name
    duration_seconds
    Type
    integer
    Description

    Optional. How long the ad was actually displayed in seconds.

  • Name
    completion_rate
    Type
    number
    Description

    Optional. Percentage of the ad that was shown (0-100). Defaults to 100 if not provided.

  • Name
    player_version
    Type
    string
    Description

    Optional. Version identifier of your media player software.

  • Name
    screen_resolution
    Type
    string
    Description

    Optional. Actual screen resolution when ad was displayed (e.g., "1920x1080").


POST/functions/v1/api/playout/confirm/[dealId]

Confirm a playout

Demo/Test Functionality

Use deal ID test-deal-test for testing and development.

  • • Returns demo playout confirmation
  • • No database modifications
  • • Accepts all optional parameters for testing

This endpoint confirms that an advertisement has been successfully displayed on a screen. Call this after the ad has finished playing to complete the advertising cycle.

Path parameters

  • Name
    dealId
    Type
    string
    Description

    The deal ID received when you accepted an offer. This identifies which ad playout you're confirming.

Optional request body

All fields in the request body are optional. You can send an empty request body or include any combination of the tracking fields.

  • Name
    played_at
    Type
    string
    Description

    ISO 8601 timestamp when the ad started playing. If not provided, defaults to current time.

  • Name
    duration_seconds
    Type
    integer
    Description

    Actual duration the ad was displayed in seconds.

  • Name
    completion_rate
    Type
    number
    Description

    Percentage completed (0-100). Use this if the ad was interrupted or only partially displayed.

  • Name
    player_version
    Type
    string
    Description

    Version of your media player software for debugging purposes.

  • Name
    screen_resolution
    Type
    string
    Description

    Actual screen resolution during playout (e.g., "1920x1080", "3840x2160").

Request

POST
/functions/v1/api/playout/confirm/[dealId]
curl -X POST "https://api.adlocaite.com/functions/v1/api/playout/confirm/f47ac10b-58cc-4372-a567-0e02b2c3d479" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Success Response

{
  "success": true,
  "playout_id": "playout_1729426192_abc123def",
  "deal_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "played_at": "2025-10-10T14:30:00Z",
  "duration_seconds": 15,
  "completion_rate": 100,
  "player_version": "AdlocaitePlayer v2.1.3",
  "screen_resolution": "1920x1080",
  "message": "Playout confirmed successfully"
}

Demo Response

{
  "success": true,
  "playout_id": "test-playout-1729426192874",
  "deal_id": "test-deal-test",
  "played_at": "2025-10-10T14:30:00Z",
  "message": "Demo playout confirmed successfully"
}

Error Response (401)

{
  "error": "Missing or invalid authorization header. Use: Bearer <publisher_api_key>"
}

Error Response (400)

{
  "error": "Invalid JSON in request body"
}

Error Response (404)

{
  "error": "Deal not found or access denied"
}

VAST integration

When you request offers with vast=true, the returned VAST XML automatically includes playout tracking URLs. Modern programmatic players can use these to automatically call the playout confirmation endpoint.

VAST tracking events

The VAST XML includes a special playout tracking event:

<TrackingEvents>
  <Tracking event="complete">
    <![CDATA[https://tracking.adlocaite.com/track?offer_id=...&event=complete]]>
  </Tracking>
  <Tracking event="playout">
    <![CDATA[https://api.adlocaite.com/playout/confirm/deal-id-here]]>
  </Tracking>
</TrackingEvents>

Automatic vs. manual confirmation

VAST-enabled players

Players that support VAST 4.0 can automatically call the playout confirmation endpoint when the ad finishes. No additional integration required.

Manual integration

For custom players or legacy systems, manually call the playout confirmation endpoint after the ad completes.


Best practices

When to confirm playouts

Confirm playouts when:
  • • The ad has finished displaying completely
  • • At least 50% of the ad content was shown
  • • The screen was active and visible during playout
Don't confirm playouts when:
  • • The ad failed to load or display
  • • The screen was turned off during playout
  • • Less than 50% of the ad was shown due to technical issues
  • • The playout was interrupted by emergency content

Error handling

Always implement proper error handling for playout confirmations:

// Example: Retry logic for playout confirmation
async function confirmPlayout(dealId, playoutData, maxRetries = 3) {
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    try {
      const response = await fetch(`/api/playout/confirm/${dealId}`, {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${apiKey}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify(playoutData)
      });
      
      if (response.ok) {
        console.log('Playout confirmed successfully');
        return await response.json();
      }
    } catch (error) {
      console.warn(`Playout confirmation attempt ${attempt} failed:`, error);
      if (attempt === maxRetries) {
        console.error('All playout confirmation attempts failed');
      }
    }
  }
}

Performance considerations

  • Non-blocking: Make playout confirmation calls asynchronously to avoid delaying your content pipeline
  • Batch processing: For high-volume screens, consider batching multiple confirmations
  • Timeout handling: Set reasonable timeouts (5-10 seconds) for confirmation requests
  • Offline handling: Cache confirmations if network connectivity is poor and retry later

Monitoring and debugging

Use the optional fields to help with monitoring and debugging:

  • player_version: Track which player versions have issues
  • screen_resolution: Identify resolution-specific problems
  • completion_rate: Monitor ad completion rates across screens
  • duration_seconds: Compare actual vs. expected playout times

Was this page helpful?