Skip to main content

Installation

Event Tracking

GAM Targeting

Overview

The Permutive Roku Client enables audience tracking and targeting on Roku devices. Built as a SceneGraph Task component, it integrates seamlessly with your Roku channel to collect events, manage identities, and target ads through Google Ad Manager.
BrightScript/SceneGraph: The Roku Client is implemented as a SceneGraph Task component (PermutiveTask.xml) that runs asynchronously alongside your channel.

Installation

1. Add the Component

Copy PermutiveTask.xml from the Permutive repository into your Roku channel’s components directory:

2. Instantiate the Client

Create and configure the Permutive Task node in your root SceneGraph component:

3. Store Globally

Store the Permutive Task node globally for access from other components:

Configuration


Identity Management

Set user identities to enable cross-platform audience matching and enrichment.

Default Identity

Set a simple string identity:

Tagged Identities

Set identities with tags and optional priority:

Identity Fields

Configure identity tags in your Dashboard identifiers settings before using them.

Event Tracking

Track events to capture user behavior and build audience segments.

View ID

Generate a new view ID for each piece of content the user engages with:
Always set a new view_id when the user starts watching new content. This links all events for that viewing session.

Tracking Events

Track events with a name and properties:

Video Events

Track standard video events for consistent analytics:

Special Properties

The Roku Client supports special property constants that are replaced with device-derived data:

Geo Information

Add geographic data based on IP:

ISP Information

Add ISP data based on IP:

Debug Mode

Enable debug mode during development to validate event schemas:
Debug mode logs schema validation errors:
Disable in production: Debug mode adds latency due to schema validation. Only use during development.

Retrieving Data

Get Cohorts

Retrieve the user’s matched cohort IDs:

Get User ID

Retrieve the Permutive user ID:

Attach Permutive targeting data to GAM ad requests:

Get Key-Values

Serialize for GAM

Convert key-values to the format GAM expects:

Attach to Ad Request

See Google’s IMA documentation for more on custom parameters.

Reset User State

Clear all Permutive data from disk and memory:
Use this when:
  • User logs out
  • User requests data deletion
  • Testing fresh state

Complete Example


Troubleshooting

Problem: Events don’t appear in the Permutive dashboard.Solutions:
  • Verify control = "run" is set after configuration
  • Check API key and workspace ID are correct
  • Enable debugMode to see validation errors
  • Ensure network connectivity on the device
  • Wait 5-10 minutes for events to process
Problem: Debug mode shows schema validation failures.Solutions:
  • Verify event names match your workspace schema
  • Check property types match expected schema types
  • Ensure required properties are included
  • Contact Technical Services to update schemas
Problem: Ads don’t show Permutive targeting.Solutions:
  • Verify gamKeyValues is populated before ad request
  • Check URL encoding of custom parameters
  • Ensure cohorts are synced to GAM in Dashboard settings
  • Verify GAM line items target Permutive key-values
Problem: cohorts array is empty.Solutions:
  • Ensure events are being tracked successfully
  • Wait for cohort processing (can take minutes)
  • Verify user qualifies for configured cohorts
  • Check cohorts are enabled for Roku in Dashboard

API Reference

Task Fields


CTV Overview

Platform selection guide

Video Tracking

Video event best practices

Google Ad Manager

GAM integration guide

Identity Management

Cross-platform identity