You can use our media tracking API to track user behavior on your media files.
Parameter Constants
The following parameters are mandatory and need to be configured (in Mapp Q3 > Configuration >…) when initializing the MIMediaParameters() object.
Parameter | Description | Where to analyze |
|---|---|---|
| The name of the video, as displayed in Intelligence | Navigation > Media > Media |
| The following actions are possible:
| Navigation > Media > Media Player Actions |
| Marks the current position of the video when sending the request. | Navigation > Media > Media Run Time |
| Specifies the total length of the video. | - |
The following parameters are optional and can be configured in the MIMediaParameters() object.
Parameter | Description | Where to configure (Mapp Q3 > Configuration > ...) | Where to analyze |
|---|---|---|---|
| You can assign additional information to the media. | Categories > Media Categories > New Category | Datatype Text: Navigation > Media Categories > [Name of media category] Datatype Figure: metric |
| Volume, number 0-255, 0 is minimal, 255 is maximal | - | Navigation > Media > Media Player Volume |
| (1=mute active, volume off, 0=mute not active, volume on) | - | Navigation > Media > Media Player Mute |
| Bandwidth bits/seconds | - | Navigation > Media > Media Bandwidth |
Methods for Media Tracking
Method | Description |
|---|---|
| Used track media events in Intelligence. It must contain the name of the file, action, position, and duration of the media. |
Example iOS
Please note that custom parameters are optional in the request.
Define all the information you want to track:
let mediaProperties = MIMediaParameters("TestVideo", action: "play", position: 12, duration: 120) mediaProperties.customCategories = [20:”customCategory”] let mediaEvent = MIMediaEvent(pageName: "Test", parameters: mediaProperties)Call the trackMedia method
MappIntelligence.shared()?.trackMedia(mediaEvent)
Full Code Example
@IBAction func trackMedia1(_ sender: Any) {
let mediaProperties = MIMediaParameters("TestVideo", action: "play", position: 12, duration: 120)
mediaProperties.customCategories = [20:”customCategory”]
let mediaEvent = MIMediaEvent(pageName: "Test", parameters: mediaProperties)
MappIntelligence.shared()?.trackMedia(mediaEvent)
}Define all the information you want to track:
MIMediaParameters* mediaProperties = [[MIMediaParameters alloc] initWith:@"TestVideo" action:@"view" position: [NSNumber numberWithInt:12] duration:[NSNumber numberWithInt:120]]; [mediaProperties setCustomCategories:[NSDictionary dictionaryWithObject:@"customCategory" forKey:@20]]; MIMediaEvent* mediaEvent = [[MIMediaEvent alloc] initWithPageName:@"Test" parameters:mediaProperties];Call the trackMedia method
[[MappIntelligence shared] trackMedia: mediaEvent];
Full Code Example
-(void)trackMedia {
MIMediaParameters* mediaProperties = [[MIMediaParameters alloc] initWith:@"TestVideo" action:@"play" position: [NSNumber numberWithInt:12] duration:[NSNumber numberWithInt:120]];
[mediaProperties setCustomCategories:[NSDictionary dictionaryWithObject:@"customCategory" forKey:@20]];
MIMediaEvent* mediaEvent = [[MIMediaEvent alloc] initWithPageName:@"Test" parameters:mediaProperties];
[[MappIntelligence shared] trackMedia: mediaEvent];
}Demo app for iOS features tracking volume and mute state through AVAudioSession.sharedInstance().
Since AVAudioSession.sharedInstance() always returns the same volume level in tvOS, volume and mute tracking its not present in the tvOS example app. However, SDK API allows setting these for tracking with Media event, thus it's possible to implement it in your own app.