API Reference
Class: Tealium
The following summarizes the commonly used methods of the Tealium
class for Python library.
Method | Description |
---|---|
resetSessionId() |
Resets the session ID as a data source |
Tealium() |
Constructor to create a Tealium object that is used to track events |
trackEvent() |
Track events with optional parameters for data and a callback |
resetSessionId()
Resets the session ID tealium_session_id
as a data source. Used when you need to start a new session other than at app start time.
resetSessionId()
Returns | Description | Example |
---|---|---|
String |
A timestamp, in milliseconds converted to a string, that is associated with all subsequent tracking. The session ID is maintained internally and automatically included as the tealium_session_id event attribute. |
"1473371215123" |
Tealium()
Creates a Tealium
object that is used to track events.
Tealium(account, profile, environment, path, datasource)
Parameters | Type | Description | Example |
---|---|---|---|
account |
String |
Tealium account name | "companyXYZ" |
profile |
String |
Tealium profile name | "main" |
environment |
String |
Tealium environment name | "prod" |
path |
String |
(Optional) Path to saved persisted data | "/path/to/persist/data" |
datasource |
String |
(Optional) data source key (required if PATH is omitted) | "abc123" |
trackEvent()
Track events with optional parameters for data and a callback.
trackEvent(title, data, callback)
Parameter | Type | Description | Example |
---|---|---|---|
title |
String |
A name to identify the event, such as a user_login variable |
"test" |
data |
Dictionary |
(Optional) Object with event data as key-value pairs | {"foo": "bar", "tealium_visitor_id": "1234567890"} |
callback |
Dictionary |
(Optional) Object with a function assigned to the “callback” key | callback = self.tealiumCallback |