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 delete a single key-value pair from the data layer, call the deleteFromDataLayer()
method.
The following example deletes the key-value pair from the data layer for the specified key:
Tealium.deleteFromDataLayer('PERSISTENT_KEY');
Gather Track Data
To gather all the data from collectors and datalayer, call the gatherTrackData()
method.
Tealium.gatherTrackData()
.then((data) => developer.log('Gather track Data: $data'))
This page was last updated: March 15, 2024