Starting from Analytics collector v3 for Android and iOS it is possible to setup custom data values in two different ways:
- Setting source independent custom data through
DefaultMetadatawhen creating the collector. These values are static and cannot be changed after creating the collector. A typical usecase for source independent custom data is the app version, or a more specific device type or platform than the one collected automatically.
- Setting custom data through
SourceMetadatafor a specific source. If some source has custom data values setup as
SourceMetadatathose values will be used when the player is playing the source.
If some custom Data fields are
nullin the SourceMetadata, the respective fields in
DefaultMetadataare used. So merging is done on a field basis (customData1, customData2, ...) with
SourceMetadatataking higher priority than
Custom data of the
SourceMetadata can be changed by calling
setCustomData with the source for which custom data should be changed as first parameter. These changes have the same lifecycle as the
SourceMetadata of the source. (
setCustomData is just an accessor to the
When custom data is changed through
setCustomData, the current measurement (or sample) is closed with the old custom data, and all subsequent samples of the current impression will use the new custom data.
It is also possible to directly change the custom data values in
SourceMetadata by resetting the
SourceMetadata while playing, but in this case, no additional samples will be sent, and the new values are picked up with the next events.
Updated about 1 month ago