Data management
Learn how to manage persistent and volatile data.
Add data
To add data to the persistent data layer, call the addToDataLayer() method.
The following example adds data to the data layer, with the Expiry set until the app restarts:
Tealium.addToDataLayer({'PERSISTENT_KEY': 'PERSISTENT_VALUE'},
Expiry.untilRestart);
Get data
To get the value for a specified key in the persistent data layer as a callback function, call the getFromDataLayer() method.
The following example gets the value for the specified key:
Tealium.getFromDataLayer('PERSISTENT_KEY')
.then((value) => print('Value From data layer: $value'));
Remove data
To remove data from the data layer, call the removeFromDataLayer() method.
The following example removes the key-value pairs from the data layer for the specified keys:
Tealium.removeFromDataLayer(['PERSISTENT_KEY']);
Gather track data
To gather all the data from collectors and datalayer, call the gatherTrackData() method.
Tealium.gatherTrackData()
.then((data) => print('Gather track data: $data'));
This page was last updated: March 31, 2026