This section specifies the syntax of the functions available in the Tealium for Roku library. Apps for Roku are written in BrightScript, a powerful scripting language. For more information read Roku’s BrightScript Language Reference.
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 as String, profile as String, logLevel as Integer) as Object
Tracks an event with associated data and, optionally, triggers a callback function.
trackEvent(eventType as String, eventName as String, data as Object, callback as Object) as Void
Tealium event type (activity, conversion, derived, interaction, or view)
Name of event (becomes the event_name attribute in UDH)
Contextual event data, an “roAssociativeArray” Object containing keys and values
An Object with a function property named ‘callback’ that accepts a “roEvent” argument. The callback function will be triggered upon completion of the TrackEvent call.
data = CreateObject("roAssociativeArray")
cb = CreateObject("roAssociativeArray")
print "Callback called!"
teal.trackEvent("activity", "someEvent", data, cb)
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 a readable string containing the configuration details of the current Tealium instance eg. “Tealium instance for account: ACCOUNT profile: PROFILE environment: ENV”