Custom Metadata is the best way to send your specific data through the Datazoom platform. We also offer a way to collect any event outside of the video player events via Datazoom Custom Events method.
Custom Metadata
- Use custom method :
setDatazoomMetadata()
- Add Custom metadata points to the HTML Page:
Custom metadata may contain 1 to n metadata key value pairs. Single value example function call:
setDatazoomMetadata("MetadataName","MetadataValue");
n values example function call:
setDatazoomMetadata([{ MetadataName1 : "MetadataValue1"},{ MetadataName2 : "MetadataValue2"},{ MetadataName3: "MetadataValue3"},..{n values}]);
Custom metadata will be added to all event messages sent back to the Datazoom Platform.
Custom metadata key value pairs will appear in the "custom" node and passed to Connectors
Example payload to Datazoom (note "custom" node below){ "customer_code": "720-jjsyye9", "configuration_id": "31864bea-334-88Uyyu", "event": { "type": "Ad_Impression", "timestamp": 1552272629231 }, "user_details": { "is_anonymous": false, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15" }, "device": { "deviceType": "pc", "osVersion": "10_14_4", "os": "Mac OS X", "browserVersion": "12.1", "browser": "Safari" }, "player": { "playerVersion": "8.8.2", "fullscreen": false, "playerName": "JWPlayer" }, "geo_location": { "regionCode": "NV", "city": "Henderson", "countryCode": "US", "latitude": 36.0395, "longitude": -114.982 }, "network": { "isp": "Cox Communications Inc.", "asn": "AS22773 Cox Communications Inc.", "asnOrganization": "Cox Communications Inc." }, "ad": { "adPosition": 1, "adPartner": "IMA" }, "custom": { "AssetId": "27-A51", "MediaFile": "https://example.com/Samples/media/source.mp4" } }
Example HTML
<!DOCTYPE html> <html> <head> <title>HTML custom metadata</title> </head> <body> <script src ="https://platform.datazoom.io/beacon/v1/config?configuration_id=XXXXXXXXXXXXXXXXX"></script> <script type="text/javascript"> setDatazoomMetadata([{AssetId:"27-A51"},{MediaFile:"https://example.com/Samples/media/source.mp4"}]); </script> </body> </html>
Custom Event
- Use custom method :
generateDatazoomEvent()
- Add Custom Events to the HTML Page
Custom event must contain a name
Example Custom event name : "ButtonPush"
Event will appear as "Custom_ButtonPush" when passed to Datazoom platform and out to Connectors - Custom event may contain 0 to n attributes (key value pairs)
This method supports custom event with custom metadata
Example callgenerateDatazoomEvent("custom_event_name"); generateDatazoomEvent("custom_event_name",[{ MetadataName1 : "MetadataValue1"},{ MetadataName2 : "MetadataValue2"}]);
Note : metadata must be given as array and metadata values are only available in this event.
Message that is sent back to Datazoom will include the Custom Event Name and Attributes plus all of the selected Metadata and FluxData that is sent back with all other messages originating from the Player CollectorExample HTML
<!DOCTYPE html> <html> <head> <title>HTML custom events and metadata</title> </head> <body> <script type="text/javascript" src ="https://platform.datazoom.io/beacon/v1/config?configuration_id=XXXXXXXXXXXXXXXXX"></script> <script type="text/javascript"> generateDatazoomEvent("ButtonPush"); generateDatazoomEvent("ButtonPush",[{customer_id:"001"},{Customer_name:"ABC"}]); </script> </body> </html>
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
Reserved Name | Description |
---|---|
amplitudeSessionId | session identifier exposed by the Amplitude plugin on the page. |
googleAnalyticsClientId | unique user identifier set by the GA SDK. Application should retrieve this value from the installed GA SDK. |
mixpanelDistinctId | unique user identifier set by the Mixpanel SDK. Application should retrieve this value from the installed Mixpanel SDK. |
userId | unique internal user identifier set by the customer's identity management system. |
genre | Genre classification of the content |
Usage Example
Use custom method :
setDatazoomMetadata()
Single value example function call:
setDatazoomMetadata("googleAnalyticsClientId","XXXX");
Connector Effect
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.
Comments
0 comments
Article is closed for comments.