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
CopyPermutiveTask.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
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | String | Yes | Your Permutive workspace API key |
workspaceId | String | Yes | Your Permutive workspace ID |
debugMode | Boolean | No | Enable schema validation logging |
control | String | Yes | Set to "run" to start the client |
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
| Field | Type | Required | Description |
|---|---|---|---|
tag | String | Yes | Identifier type (must be configured in Dashboard) |
id | String | Yes | The identifier value |
priority | Integer | No | Priority for identity resolution (lower = higher priority) |
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: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:| Constant | Description |
|---|---|
$ip_geo_info | Geographic information derived from IP address |
$ip_isp_info | Internet Service Provider information derived from IP |
Debug Mode
Enable debug mode during development to validate event schemas:Retrieving Data
Get Cohorts
Retrieve the user’s matched cohort IDs:Get User ID
Retrieve the Permutive user ID:Google Ad Manager Targeting
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
Reset User State
Clear all Permutive data from disk and memory:- User logs out
- User requests data deletion
- Testing fresh state
Complete Example
Troubleshooting
Events not being tracked
Events not being tracked
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
debugModeto see validation errors - Ensure network connectivity on the device
- Wait 5-10 minutes for events to process
Schema validation errors
Schema validation errors
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
GAM targeting not working
GAM targeting not working
Problem: Ads don’t show Permutive targeting.Solutions:
- Verify
gamKeyValuesis 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
Cohorts empty
Cohorts empty
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
| Field | Type | Access | Description |
|---|---|---|---|
apiKey | String | Write | Workspace API key |
workspaceId | String | Write | Workspace ID |
debugMode | Boolean | Write | Enable schema validation |
control | String | Write | Set to “run” to start |
identity | String/Object | Write | Set user identity |
view_id | String | Write | Current view session ID |
event | Object | Write | Track an event |
reset | Boolean | Write | Clear all state |
cohorts | String[] | Read | User’s cohort IDs |
userId | String | Read | Permutive user ID |
gamKeyValues | Object | Read | GAM targeting key-values |