Fallback mechanisms

Alternative ways to manage new non-linear ad formats for devices not compatible with SIMID

As described in the introduction to BannersIn2, this SIMID-based solution is not compatible with all devices, in particular those that cannot render a web view on top of the video player.

The BannersIn2 solution does provide a fallback mechanism for those devices with a workflow very similar, although the app developer will have the additional burden of handling the interpretation of all ad parameters, rendering of the ad, error handling, tracking, etc.

Overall flow

The flow is very similar to the one presented in Client-side implementation, but there is no SIMID controller, nor any SIMID self-contained creative.

  1. When the app launches, SmartLib is initialised

  2. For each video load (i.e., each channel change), a SmartLib session is created

    1. The app calls SmartLib.getInstance().createStreamingSession() and stores the session object.
    2. The app attaches the video player instance to Smartlib with session.attachPlayer(playerInstance).
    3. The boolean SmartLib session option AD_TRACKERS_NON_LINEAR_AUTO_SEND must be set to false as SmartLib is unable to send trackers automatically in this type of scenario
  3. The app calls session.setAdEventsListener(…) so that the app can receive ad events.

  4. The app calls session.getURL(contentURL) to start the streaming session.

  5. When SmartLib detects an ad break

    1. 🌟 onPrepareAdBreak(adBreakData) is triggered a few seconds before the start of the ad break, in all cases (whether the ad break contains linear non-linear ads). In most situations, this event can be ignored, but could be useful in specific scenarios.

    2. 🌟 onPrepareAd(adBreakData, adData) is triggered a few seconds before the start of an ad

      1. 🌟 The app determines if the ad has non-linear ads attached

        1. on Web and iOS, this is done by looking up the field adData.adType, which will contain one of the following values:

          linearThe ad only contains a linear creative
          nonlinearThe ad only contains a non-linear creative
          linear_and_nonlinearThe ad contains both linear and non-linear creatives
        2. on Android, this is done by calling adData.getType(), which returns an enum value

          AD_LINEARThe ad only contains a linear creative
          AD_NON_LINEARThe ad only contains a non-linear creative
          AD_LINEAR_AND_NON_LINEARThe ad contains both linear and non-linear creatives
      2. If a non-linear creative is present, the app retrieves the metadata for the Static resource:

        1. On Web and iOS, by looking up adData.nonLinearStaticResources
        2. On Android, by calling adData.getNonLinearStaticResources()

        Both return an array of objects with the following properties:

        propertytypedescription
        creativeIdstringID of the creative to display
        urlstringURL of the SIMID resource
        parametersstringContains information that needs to be passed to the SIMID Creative through the Player:init. It contains a stringified JSON object but it is the creative’s responsibility to parse and interpret it.
        clickURLstringURL of the click-through (landing page URL typically)
      3. The app loads the url of the main static resource, and parses and interprets the information contained in the parameters (which may contain instructions related to the functionality and behaviour of the app - this will be specific to each type of creative template​)

    3. onAdBreakBegin(adBreakData) is triggered when the ad break starts.

    4. onAdBegin(adBreakData, adData) is triggered when an ad starts.

      1. The app renders the creative in the appropriate way, typically as an overlay on top of the video player.
      2. If necessary, the app also resizes the video player to a specific area of that creative (defined in the ad parameters).
      3. After successfully displaying the creative, the app instructs Smartlib to fire the impression and creativeView trackers, by sending session.sendTracker(trackerType, adId) - as described here
    5. onAdEnd(adBreakData, adData) is triggered when the ad ends

      1. The app removes and destroys the creative
      2. The app resets the size of the video player if necessary
    6. onAdBreakEnd(adBreakData) is triggered when the ad break ends

Creative functionality

Depending on the creative template​ used, there may be additional functionality that needs to be implemented by the app developer.

Click-through

Ads may be decorated with a click-through URL in their metadata, typically with the URL to a landing page.

On devices that support the ability to open a browser app or page, the app will have to provide a way for the user to "click" the ad.

After the user clicked the ad, the app will also need to instruct SmartLib to fire the associated trackers, with session.sendTracker("nonlinearClickTracking", adId)

Usually, the application will also pause playback, although that is scenario-dependent and left at the discretion of the app developer.

Error tracking

If there is an issue and the app determines that it cannot render the creative, for whatever reason, it must instruct SmartLib to send an error tracker, with session.sendTracker("error", adId, creativeId, optionalErrorObject), in which:

  • adId is the ad identifier (obtained from the AdData object exposed by onAdBegin)
  • creativeId is the creative identifier (optional)
  • optionalErrorObject is an object with the following sub-properties:
    • errorCode: number or undefined
    • errorMessage: string or undefined

The app developer should set those 2 properties to something meaningful that allows them to perform troubleshooting on the basis of error logs received by broadpeak.io. It is recommend to avoid using the same error codes as used by the SIMID protocol, to avoid confusion.



Did this page help you?