Logo

Application collectors

Google IMA Ad Framework

For the IOS / tvOS Collector with AVPlayer Media Player v3

The Google IMA Ad Framework Extension is a configuration option for the IOS / tvOS Collector by Datazoom when it is configured with the AVPlayer Media Player v3 to make the following additional data points automatically collectable in real time.

Integration Instructions

The Datazoom IMA Adapter enables seamless tracking of ad playback events from Google IMA and sends them to our data collection platform. This library simplifies integration by offering a straightforward API to observe and forward ad events to Datazoom.

📦 Dependency

Installing DzIMAAdapter

DzIMAAdapter supports Swift Package Manager and CocoaPods

Swift Package Manager

To install DzIMAAdapter using Swift Package Manager you can follow the tutorial published by Apple using the URL for the DzIMAAdapter repos with the current version:

iOS

  1. In Xcode, select “File” → “Add Packages...”
  2. Enter https://gitlab.com/datazoom/apple/libraries-release/apple_dz_ima_adapter_ios for DzIMAAdapter_iOS

tvOS

  1. In Xcode, select “File” → “Add Packages...”
  2. Enter https://gitlab.com/datazoom/apple/libraries-release/apple_dz_ima_adapter_tvos for DzIMAAdapter_tvOS

CocoaPods

iOS

Add the pod to your Podfile:

source 'https://gitlab.com/datazoom/pod-specs.git'
pod 'DzIMAAdapter_iOS'

tvOS

Add the pod to your Podfile:

source 'https://gitlab.com/datazoom/pod-specs.git'
pod 'DzIMAAdapter_tvOS'

imports

iOS

import DzIMAAdapter_iOS

tvOS

import DzIMAAdapter_tvOS

🚀 Getting Started

Step 1. Create Datazoom adapter

let dzAdapter = Datazoom.shared.createContext(player: Your AVPlayer instance) 

2. Hook into IMA Ads using ImaAdsLoader and observe ad events

Import the helper extension:

import DzIMAAdapter_iOS

or

import DzIMAAdapter_tvOS

Set up your IMA ads loader and attach the ad event listener:

  // MARK: - IMAAdsManagerDelegate

  func adsManager(_ adsManager: IMAAdsManager, didReceive event: IMAAdEvent) {
        
    // Send recieved ad event from IMA to the Datazoom dzAdapter
    dzAdapter.sendAdEvent(adEvent: event, adsManager: adsManager)
   
    // your implentation
  }

Log the ad error:

  func adsLoader(_ loader: IMAAdsLoader, failedWith adErrorData: IMAAdLoadingErrorData) {
      // Send recieved ad error event from IMA to the Datazoom dzAdapter
     dzAdapter?.sendAdError(error: adErrorData.adError)
  }

or

  func adsManager(_ adsManager: IMAAdsManager, didReceive error: IMAAdError) {
    // Something went wrong with the ads manager after ads were loaded.
    // Log the error
    dzAdapter?.sendAdError(error: error)
  }

3. Attach adsLoader to your player and ad view group as usual

These are sent in real time to power your Datazoom analytics pipeline.

🧩 Requirements

  • iOS app using AVPlayer and DzAVPlayerAdapter
  • Datazoom SDK integrated and configured

📬 Support

Need help integrating or have questions?

📧 Email: support@datazoom.io
🌐 Website: https://help.datazoom.io