Configure Video Analytics real-time video tracking (video heartbeat) in a PSDK-based player.
The following items are required to activate real-time video tracking (video heartbeat) in a PSDK-based player for iOS:
To configure real-time video tracking in your PSDK-based player:
{
"version" : "1.1",
"analytics" : {
"rsids" : "YOUR_ADOBE_ANALYTICS_RSID",
"server" : "URL_OF_THE_ADOBE_ANALYTICS_TRACKING_SERVER (provided by Adobe)",
"charset" : "UTF-8",
"ssl" : false,
"offlineEnabled" : false,
"lifecycleTimeout" : 5,
"batchLimit" : 50,
"privacyDefault" : "optedin",
"poi" : []
},
"target" : {
"clientCode" : "",
"timeout" : 5
},
"audienceManager" : {
"server" : ""
}
}
For more information on these AppMeasurement settings, see Measuring Video in Adobe Analytics.
Video Analytics configuration follows the usual pattern of setting a specific metadata object on the PTMediaPlayerItem instance that is about to be sent to the player for playback.
Sample Video Analytics configuration:
// Instantiate VideoAnalytics tracking metadata.
PTVideoAnalyticsTrackingMetadata *trackingMetadata =
[[[PTVideoAnalyticsTrackingMetadata alloc]
initWithTrackingServer:@"THE_URL_OF_THE_VIDEO_HEARTBEATS_SERVER (provided by Adobe)"
jobId:@"YOUR_JOB_ID"
publisher:@"YOUR_PUBLISHER_NAME"] autorelease];
trackingMetadata.playerName = @"the name of your player app";
// Set this to true to activate the debug tracing.
trackingMetadata.debugLogging = YES;
// Set this to true to log the URLs of the output HTTP calls.
trackingMetadata.debugTracking = YES;
// Setting this to YES activates the "quiet" mode.
trackingMetadata.trackLocal = YES;
// Explicitly activate the video heartbeat functionality.
trackingMetadata.enableHeartbeat = YES;
// Set the metadata on the ROOT metadata.
PTMetadata *root = [[[PTMetadata alloc] init] autorelease];
[root setMetadata: trackingMetadata forKey: PTVideoAnalyticsTrackingMetadataKey];
// Attach the ROOT metadata on the media item.
PTMediaPlayerItem *mediaItem = [[[PTMediaPlayerItem alloc] initWithUrl:nsurl mediaId:@"video-id" metadata:metadata] autorelease];
// Create a new Video Analytics Tracker instance using the current media player instance to start tracking video analytics data
self.videoAnalyticsTracker = [[[PTVideoAnalyticsTracker alloc] initWithMediaPlayer:self.player] autorelease];