Simple Use Cases
The following samples are suitable for simple use cases, where the browser page usually contains only a single video player, and the custom metadata are managed as a whole for the browser session.
The custom metadata will be persisted in the
sessionStorage, so it will remain valid until the browser tab is closed, or until it is cleared with the following call:
The current custom metadata (which was previously set or was restored from the storage) can be read back as in the following example:
Generate Custom Event
To generate a Datazoom event with a custom name, call the following function with the custom name (which will be prefixed with “Custom_“
An optional argument can be included in the same function to add additional metadata (for the event generated by the specific call only) to the event message:
By default, if available, the playback related data points (such as the metrics of the current view) from the first player on the page will be included in the custom event message generated.
If the extra metadata specified with the
generateEvent() call has duplicated keys as in the existing metadata previously set, the value from the extra metadata will take precedence of the existing one. However, since the extra metadata is only effective to the specific call where it is specified, the existing metadata’s value of the same key will not be affected in other places.
Custom Metadata Reserved Names
Some data values that are key to functionality or reporting on your analytic systems have been designated as
Reserved Names so that these values can be handled properly within the context of the receiving Connector.
Current List of Reserved Names
|amplitudeSessionId||session identifier exposed by the Amplitude plugin on the page.|
unique user identifier set by the GA SDK. Application should retrieve this value from the installed GA SDK.
unique user identifier set by the Mixpanel SDK. Application should retrieve this value from the installed Mixpanel SDK.
unique internal user identifier set by the customer's identity management system.
|genre||Genre classification of the content|
Use custom method :
Single value example function call:
When a Reserved Name is properly set using Custom Metadata, it will be correctly placed within designated fields within the relevant Connector. For all other Connectors, these values will be treated like regular Custom Metadata and passed through if the Connector can support custom key value pairs.