Reference guide for Tealium.Config class and methods provided by Tealium for Android.
Class: Tealium.Config
The following summarizes the commonly used methods of the Tealium.Config class.
| Method | Description |
|---|---|
create() | Create instance of the Config object |
enableConsentManager() | Enable consent manager |
isConsentManagerEnabled() | Checks if consent manager is enabled |
sessionCountingEnabled | Disables session counting for Tealium iQ accounts. Use this if you are self-hosting your Tealium JavaScript files |
setDatasourceId() | Sets the data source key |
setForceOverrideLogLevel() | Set to force a specific log level at init time |
setOverrideCollectDispatchProfile() | Overrides the Tealium Collect profile |
setOverrideCollectDispatchUrl() | Overrides the Tealium Collect URL |
setOverrideVisitorServiceDomain() | Overrides the Tealium Collect visitor service domain |
setSecondsBeforeBatchTimeout() | Sets the number of seconds before batch timeout |
create()
Create instance of the Config object.
Tealium.Config config = Tealium.Config.create(
application,
account,
profile,
environment);
The Tealium Config instance is configured with the following parameters:
| Parameters | Type | Description | Example |
|---|---|---|---|
application | Application | The application instance | applicationObj |
account | String | Tealium account name | "companyXYZ" |
profile | String | Tealium profile name | "main" |
environment | String | Tealium environment name | ["dev", "qa", "prod"] |
enableConsentManager()
Enable consent manager. This method is to be used before Tealium initialization.
public final String TEALIUM_INSTANCE = "main";
final Tealium.Config config = Tealium.Config.create(...);
config.enableConsentManager(TEALIUM_INSTANCE);
| Parameter | Type | Description | Example |
|---|---|---|---|
instance | String | Tealium instance name | "main" |
isConsentManagerEnabled()
Checks if consent manager is enabled.
config.isConsentMangerEnabled()
sessionCountingEnabled
Disables session counting for Tealium iQ accounts. Use this if you are self-hosting your Tealium JavaScript files. Default true.
config.sessionCountingEnabled = false
setDatasourceId()
Sets the data source key.
config.setDataSourceId(dataSourceId);
| Parameters | Type | Description | Example |
|---|---|---|---|
dataSourceId | String | Data source key (Set to null if none) | "abc123" |
setForceOverrideLogLevel()
Set to force a specific log level at init time. Returns instance of the config object for method chaining.
config.setForceOverrideLogLevel(forceOverrideLogLevel);
The following String options are available for forceOverrideLogLevel:
| Log Level | Description |
|---|---|
"dev" | Activity, Info, Warnings, and Errors |
"qa" | Info, Warnings, and Errors |
"prod" | Errors |
"silent" | None |
setOverrideCollectDispatchProfile()
Overrides the Tealium Collect dispatch profile.
config.setOverrideCollectDispatchProfile(profile);
| Parameters | Type | Description |
|---|---|---|
profile | String | The Tealium Collect profile to override |
setOverrideCollectDispatchUrl()
Overrides the Tealium Collect dispatch URL to send data to a different endpoint.
config.setOverrideCollectDispatchUrl(url);
| Parameters | Type | Description |
|---|---|---|
url | String | The URL to override |
The default URL is:
https://collect.tealiumiq.com/event/
The default URL with event batching is:
https://collect.tealiumiq.com/bulk-event/
The method is typically used to set a custom hostname, or to set a specific region hostname. The following example sets the Tealium Collect base URL to stay within the EU Central region:
config.setOverrideCollectDispatchUrl("https://collect-eu-central-1.tealiumiq.com/event/");
setOverrideVisitorServiceDomain()
Overrides the Tealium Collect visitor service domain to send data to a different domain.
config.setOverrideVisitorServiceDomain(domain);
| Parameters | Type | Description |
|---|---|---|
domain | String | The visitor service domain to override |
setSecondsBeforeBatchTimeout()
Sets the number of seconds before batch timeout. If the batch size limit has not been reached before reaching the timeout, the queued events are dispatched.
config.setSecondsBeforeBatchTimeout(timeout);
| Parameters | Type | Description | Example |
|---|---|---|---|
timeout | int | The timeout, in seconds, for the batch to be sent. | 30 |
This page was last updated: September 4, 2025