In some ad tracking scenarios, you could encounter
main:play calls occurring unexpectedly between the end of one ad and the start of the next ad. If the delay between the ad complete call and the next ad start call is greater than 250 milliseconds, the Media SDK will fall back to sending
main:play calls. If this fallback to
main:play occurs during a pre-roll ad break, the content start metric may be set early.
A gap between ads such as described above is interpreted by the Media SDK as main content, because there is no overlap there with any ad content. The Media SDK does not have any ad information set on it, and the player is in the playing state. If there is no Ad information, and the player state is playing, then the Media SDK credits the duration of the gap towards main content by default. It cannot credit playback duration toward null ad information.
While using Adobe Debug or a network packet sniffer such as Charles, if you see the following Heartbeat calls in this order during a pre-roll ad break:
Main Content Play:
Main Content Play:
Delay triggering the Ad Complete call.
Handle the gap from within the player by calling
trackEvent:AdComplete late for the first ad, followed immediately by
trackEvent:AdStart for the second ad. The app should hold off on calling the
AdComplete event after the first ad finishes. Make sure you call
trackEvent:AdComplete for the last ad in the ad break. If the player can identify that the current ad asset is the final one in the ad break, call
trackEvent:AdComplete immediately. This resolution will result in less than 1 second of additional ad time spent being attributed to the preceding ad unit.
On ad break start, including pre-roll:
adBreak object instance for the ad break; for example,
On every ad asset start:
Call this only if the previous ad wasn’t complete. Consider a Boolean value to maintain an “
isinAd” state for the previous ad.
Create the ad object instance for the ad asset: for example,
Populate the ad metadata,
trackEvent(MediaHeartbeat.Event.AdStart, adObject, adCustomMetadata);.
trackPlay() if this is the first ad in a pre-roll ad break.
On every ad asset complete:
Do not make a call
If the application knows it is the last ad in the ad break, call
trackEvent:AdComplete here and skip setting
trackEvent:AdComplete in the
On ad skip:
On ad break complete:
If this step is already performed above as part of the last
trackEvent:AdComplete call then this can be skipped.