API Reference
The following specifies the functions available in the Tealium for Roku library. Apps for Roku are written in BrightScript, a powerful scripting language. Learn more about BrightScript.
Class: TealiumBuilder
The following summarizes the commonly used methods of the TealiumBuilder
class for Roku library.
Method | Description |
---|---|
SetDatasource() |
Sets the data source key of the Tealium object |
SetEnvironment() |
Sets the environment of the Tealium object |
SetLogLevel() |
Sets the log level of the Tealium object |
TealiumBuilder() |
A builder constructor function to help initialize the Tealium object |
SetDatasource()
Sets the data source key of the Tealium
object.
SetDatasource(datasource)
Parameters | Type | Description | Example |
---|---|---|---|
datasource |
String |
Data source key | “def456” |
SetEnvironment()
Sets the environment of the Tealium
object.
SetEnvironment(environment)
Parameters | Type | Description | Example |
---|---|---|---|
environment |
String |
Tealium environment name | ["dev" , "qa" , "prod" ] |
SetLogLevel()
Sets the log level of the Tealium
object.
SetLogLevel(logLevel)
Parameters | Type | Description | Example |
---|---|---|---|
logLevel |
Integer | Tealium log level | 1 |
TealiumBuilder()
A builder function to help initialize the Tealium
object. Set optional parameters using the utility functions. Create the Tealium object by calling Build().
TealiumBuilder(account, profile, logLevel)
Parameters | Type | Description | Example |
---|---|---|---|
account |
String |
Tealium account name | "account123" |
profile |
String |
Tealium profile name (default: "main" ) |
"main" |
logLevel |
String |
Log level | 1 |
Class: TealiumCore
The following summarizes the commonly used methods of the TealiumCore
class for Roku library.
Method | Description |
---|---|
ToStr() |
Returns a readable String containing the configuration details of the current Tealium instance |
TrackEvent() |
Tracks an event with associated data and, optionally, triggers a callback function |
ResetSessionId() |
Resets and returns a new session ID |
ToStr()
Returns a readable String containing the configuration details of the current Tealium instance.
ToStr()
Returns | Return Type | Example |
---|---|---|
Readable String containing the configuration details of the current Tealium instance | String |
"Tealium instance for account: ACCOUNT profile: PROFILE environment: ENV" |
TrackEvent()
Tracks an event with associated data and, optionally, triggers a callback function.
trackEvent(eventType, eventName, data, callback)
Parameters | Type | Description |
---|---|---|
eventType |
String |
Tealium event type (activity, conversion, derived, interaction, or view) |
eventName |
String |
Name of event (becomes the event_name attribute in Tealium Customer Data Hub) |
data |
Object |
Contextual event data, an roAssociativeArray object containing keys-value pairs |
callback |
Object |
An Object with a function property named ‘callback’ that accepts a roEvent argument. The callback function is triggered upon completion of the TrackEvent call. |
The callback function is used for a number of purposes including:
- To build a retry or fallback system for failed calls
- To manage a queueing or throttling system
- To customize the Logger
- To chain application logic
ResetSessionId()
Resets and returns a new session ID. The session ID identifies the current user session, similar to a website session, but it does not expire. A new session ID is created each time createTealium()
is called.
resetSessionId() as Integer
Returns | Return Type |
---|---|
A new session ID | Integer |
Was this article helpful?
This page was last updated: February 14, 2020