Initialize and configure Video Analytics

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:

  • Adobe PSDK for iOS
  • Configuration / Initialization Information - Your Adobe representative provides your specific video-tracking account information:
    ADBMobileConfig.json
    Note: IMPORTANT: The name and the path of this configuration file must not change. This JSON config file must be named ADBMobileConfig.json. The path to this file must be <source root>/AdobeMobile.
    AppMeasurement tracking server endpoint The URL of the Adobe Analytics (formerly SiteCatalyst) back-end collection end-point.
    Video Analytics tracking server endpoint The URL of the Video Analytics back-end collection end-point. This is where all video heartbeat tracking calls are sent.
    Account name Also known as the Report Suite ID (RSID).
    Job ID The processing job identifier. This indicates to the back-end endpoint which kind of processing to apply for the video-tracking calls.
    Publisher The name of the content publisher (the brand or television channel using the video tracking capabilities).

To configure real-time video tracking in your PSDK-based player:

  1. Configure load-time options in the ADBMobileConfig.json resource file:
    {
        "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" : ""
        }
    }

    Your load-time options are specified in this JSON-formatted configuration file. This file is bundled as a resource with the PSDK. The Primetime Player reads these values only at load time; they remain constant while your application runs. To configure load-time options:

    1. Confirm that the JSON config file (ADBMobileConfig.json) contains the appropriate values (supplied by Adobe).
    2. Confirm that this file is located in the AdobeMobile folder. This folder must be located in the root of your application source tree.
    3. Compile and build your application.
    4. Deploy and run the bundled application.

    For more information on these AppMeasurement settings, see Measuring Video in Adobe Analytics.

  2. Configure and activate Video Analytics and the PSDK's video heartbeat tracking.

    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. The VideoAnalytics metadata object has mandatory and optional configuration parameters.

    1. Set mandatory configuration parameters (provided by Adobe). Provide these as input arguments to the constructor for the PTVideoAnalyticsTrackingMetadata class:
      • URL of the Video Analytics tracking endpoint
      • Job ID
      • Publisher Name
    2. Set optional configuration parameters. These are publicly accessible instance variables on the PTVideoAnalyticsTrackingMetadata class.
      Important: To send heartbeat calls over the network, you must explicitly enable the video heartbeat feature. If you do not, no video heartbeat calls will be sent; the legacy Milestone tracking provided by the AppMeasurement library will be used instead.
      • enableHeartbeat - Explicitly activate heartbeat tracking ( trackingMetadata.enableHeartbeat = YES;) to activate the video heartbeat calls used for real-time analytics and Video Essentials.
      • debugLogging - Set this flag to true to activate tracing messaging. Note that setting this flag to true may impact performance. This logging might be useful during development and debugging efforts, but you must set this flag to false for the production version of your player application. Logging is disabled (false) by default.
      • trackLocal - Set this flag to true to activate quiet mode. In this mode, no network calls are sent over the network. You can use this mode in conjunction with setting the debugTracking flag to true. In this case, you can see the HTTP calls in the trace console without actually sending anything over the network.
      • debugTracking - Set this flag to true to track URLs in HTTP calls.

    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 = @"YOUR_PLAYER_APP_NAME";
     
    // 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;
     
    // This defaults to YES, which activates the "quiet" mode.
    // Make sure "quiet mode" is NOT on, to actually send network calls.
    trackingMetadata.trackLocal = NO;
     
    // 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:root] autorelease];
    

    After you provide the metadata to the PTMediaPlayerItem, call the initWithMediaPlayer method right after the player has been created.

    // 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];