Show Menu
TOPICS×

Initialize and configure video analytics

You can configure your player to track and analyze video use. Before activating video tracking (video heartbeats), ensure that you have the following:
  • TVSDK 3.0 for Android.
  • Configuration / Initialization Information
    Contact your Adobe representative for your specific video-tracking account information:
ADBMobileConfig.json
Important: This JSON config file name must remain ADBMobileConfig.json . The name and the path of this configuration file cannot be changed. The path to this file must be <source root>/assets .
AppMeasurement tracking server endpoint The URL of the Adobe Analytics (formerly SiteCatalyst) back-end collection endpoint.
Video analytics tracking server endpoint The URL of the video analytics back-end collection endpoint. This is where all video heartbeat tracking calls are sent.
Tip: The URL of the visitor tracking server is the same as the URL of the analytics tracking server. For information about implementing the Visitor ID Service, see Implement ID Service .
Account name Also known as the Report Suite ID (RSID).
Marketing Cloud organization ID A string value required for instantiating the Visitor component.
To configure video tracking in your player:
  1. Confirm that load-time options in the ADBMobileConfig.json resource file are correct.
    ```    
           { 
               "version" : "1.1", 
               "analytics" : { 
                   "rsids" : "adobedevelopment", 
                   "server" : "10.131.129.149:3000", 
                   "charset" : "UTF-8", 
                   "ssl" : false, 
                   "offlineEnabled" : false, 
                   "lifecycleTimeout" : 5, 
                   "batchLimit" : 50, 
                   "privacyDefault" : "optedin", 
                   "poi" : [] 
               }, 
               "marketingCloud": { 
                   "org": "ADOBE PROVIDED VALUE"  
               }, 
               "target" : { 
                   "clientCode" : "", 
                   "timeout" : 5 
               }, 
               "audienceManager" : { 
                   "server" : "" 
               } 
           }
           ```    
        
           This JSON-formatted configuration file is bundled as a resource with TVSDK. Your player reads these values only at load time, and the values remain constant while your application runs.
    
           To configure load-time options:
    
    
    1. Confirm that the ADBMobileConfig.json file contains the appropriate values (provided by Adobe).
    2. Confirm that this file is located in the assets/ 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 about these AppMeasurement settings, see Measuring Video in Adobe Analytics .
  2. Initialize and configure video heartbeat tracking metadata.
    You can stop the video analytics module midstream and reinitialize it again as necessary. Before the module is reinitialized, ensure that the video analytics metadata is also updated to the correct content metadata. To recreate the metadata, repeat the first two steps below (sub-steps a and b ).
    1. Create an instance of the Video Analytics metadata.
      This instance contains all of the configuration information that is needed to enable video heartbeat tracking. For example:
      private VideoAnalyticsMetadata getVideoAnalyticsTrackingMetadata() { 
          VideoAnalyticsMetadata vaMetadata = new VideoAnalyticsMetadata(); 
      
          vaMetadata.setTrackingServer("example.com"); 
          vaMetadata.setChannel("test-channel"); 
          vaMetadata.setVideoName("myvideo"); 
          vaMetadata.setVideoId("myvideoid"); 
          vaMetadata.setPlayerName("PSDK Player"); 
          vaMetadata.setUseSSL(false); 
          vaMetadata.debugLogging = true; // Set to NO for production deployment. 
          vaMetadata.setEnableChapterTracking(true); 
          // use this API to override the default asset length -1 for live streams 
          vaMetadata.setAssetDuration(SAMPLE_ASSET_DURATION); 
      
          return vaMetadata; 
      }
      
      
    2. Initialize the Video Analytics provider.
      After creating a media player instance, you must create a Video Analytics provider instance and provide the application context to it.
      Always create a new provider instance for each content playback session and remove the previous reference after you detach the media player instance.
      VideoAnalyticsProvider videoAnalyticsProvider = new VideoAnalyticsProvider(appContext); 
      
      
      
    3. Set the Video Analytics metadata on the videoAnalyticsProvider instance.
      videoAnalyticsProvider.setVideoAnalyticsMetadata(vaMetadata);
      
      
    4. Attach the media player instance to the videoAnalyticsProvider instance:
      videoAnalyticsProvider.attachMediaPlayer(mediaPlayer); 
      
      
    5. Destroy the Video Analytics provider.
      Before you begin a new content playback session, destroy the previous instance of the video provider. After you receive the content complete event (or notification), wait a few minutes before you destroy the video analytics provider instance. Destroying the instance immediately might interfere with the Video Analytics provider's ability to send a "video complete" ping.
      if (videoAnalyticsProvider) { 
          videoAnalyticsProvider.detachMediaPlayer(); 
          videoAnalyticsProvider = null; 
      }
      
      
    6. Manually mark the Live/Linear stream as complete.
      If you have various episodes on one live stream, you can manually mark an episode as complete by using the complete API. This ends the video tracking session for the current video episode, and you can start a new tracking session for the next episode.
      This API is optional and does not work for VOD video tracking.
      if (videoAnalyticsProvider) { 
          videoAnalyticsProvider.trackVideoComplete();    
      }