Legacy - Media SDK Setup Overview
- Topics:
- Media Analytics
CREATED FOR:
- User
- Admin
- Developer
After you download the Media SDK for your video app or player, follow the information in this section to setup and implement the Media SDK.
General Implementation Guidelines
There are three main SDK components used in tracking with the Streaming Media Collection:
- Media Heartbeat Config—The
MediaHeartbeatConfig
contains the basic settings for reporting. - Media Heartbeat Delegate—The
MediaHeartbeatDelegate
controls playback time and the QoS object. - Media Heartbeat—The
MediaHeartbeat
is the primary library containing members and methods.
Implement the Streaming Media SDK
To setup and use the Streaming Media SDK, complete the following implementation steps:
-
Create a
MediaHeartbeatConfig
instance and set your configuration parameter values.Variable NameDescriptionRequiredDefault ValuetrackingServer
Tracking server for media analytics. This is different from your analytics tracking server.YesEmpty Stringchannel
Channel nameNoEmpty Stringovp
Name of the online media platform through which content gets distributedNoEmpty StringappVersion
Version of the media player app/SDKNoEmpty StringplayerName
Name of the media player in use, i.e., “AVPlayer”, “HTML5 Player”, “My Custom Player”NoEmpty Stringssl
Indicates whether calls should be made over HTTPSNofalsedebugLogging
Indicates whether debug logging is enabledNofalse -
Implement the
MediaHeartbeatDelegate
.Method nameDescriptionRequiredgetQoSObject()
Returns theMediaObject
instance that contains the current QoS information. This method will be called multiple times during a playback session. Player implementation must always return the most recently available QoS data.YesgetCurrentPlaybackTime()
Returns the current position of the playhead.
For VOD tracking, the value is specified in seconds from the beginning of the media item.
For live streaming, if the player does not provide information about the content duration, the value can be specified as the number of seconds since midnight UTC of that day.
Note: When using progress markers, the content duration is required and the playhead needs to be updated as number of seconds from the beginning of the media item, starting with 0.YesTIP
The Quality of Service (QoS) object is optional. If QoS data is available for your player and you wish to track that data, then the following variables are required:Variable nameDescriptionRequiredbitrate
The bitrate of media in bits per second.YesstartupTime
The start up time of media in milliseconds.Yesfps
The frames displayed per second.YesdroppedFrames
The number of dropped frames so far.Yes -
Create the
MediaHeartbeat
instance.Use the
MediaHertbeatConfig
andMediaHertbeatDelegate
to create theMediaHeartbeat
instance.IMPORTANT
Make sure that yourMediaHeartbeat
instance is accessible and does not get deallocated until the end of the session. This instance will be used for all the following media tracking events.TIP
MediaHeartbeat
requires an instance ofAppMeasurement
to send calls to Adobe Analytics. -
Combine all of the pieces.
The following sample code utilizes our JavaScript 2.x SDK for an HTML5 video player:
// Create local references to the heartbeat classes var MediaHeartbeat = ADB.va.MediaHeartbeat; var MediaHeartbeatConfig = ADB.va.MediaHeartbeatConfig; var MediaHeartbeatDelegate = ADB.va.MediaHeartbeatDelegate; //Media Heartbeat Config var mediaConfig = new MediaHeartbeatConfig(); mediaConfig.trackingServer = "[your_namespace].hb.omtrdc.net"; mediaConfig.playerName = "HTML5 Basic"; mediaConfig.channel = "Video Channel"; mediaConfig.debugLogging = true; mediaConfig.appVersion = "2.0"; mediaConfig.ssl = false; mediaConfig.ovp = ""; // Media Heartbeat Delegate var mediaDelegate = new MediaHeartbeatDelegate(); // Set mediaDelegate CurrentPlaybackTime mediaDelegate.getCurrentPlaybackTime = function() { return video.currentTime; }; // Set mediaDelegate QoSObject - OPTIONAL mediaDelegate.getQoSObject = function() { return MediaHeartbeat.createQoSObject(video.bitrate, video.startuptime, video.fps, video.droppedframes); } // Create mediaHeartbeat instance this.mediaHeartbeat = new MediaHeartbeat(mediaDelegate, mediaConfig, appMeasurementInstance);
Validate
Media Analytics tracking implementations generate two types of tracking calls:
-
Media and ad Start calls are sent directly to the Adobe Analytics (AppMeasurement) server.
-
Heartbeat calls are sent to the Media Analytics (heartbeats) tracking server, processed there, and passed on to the Adobe Analytics server.
-
Adobe Analytics (AppMeasurement) server
For more information about tracking server options, see Correctly populate the trackingServer and trackingServerSecure variables.IMPORTANT
An RDC tracking server or CNAME resolving to an RDC server is required for Experience Cloud Visitor ID service.The analytics tracking server should end in “
.sc.omtrdc.net
” or be a CNAME. -
** Media Analytics (Heartbeats) server**
This always has the format “[your_namespace].hb.omtrdc.net
”. The value of “[your_namespace]
” specifies your company, and is provided by Adobe.
Media tracking works the same across all platforms, desktop and mobile. Audio tracking currently works on mobile platforms. For all tracking calls there are a few key universal variables to be validated: