Avoiding manual implementation of media-related beacons is this module’s goal, our implementation uses our own AMP callbacks to notify Media Analytics so you don’t have to.
Just import the AmpMediaAnalytics.framework in your project. For more information check out the AmpCore’s documentation.
*Note: Make sure to add the frameworks as
Embedded Binaries or you’ll get an error about a missing image. *
How to Use
Let’s first import the required frameworks:
Then, let’s add the related variables in our
var ampPlayer: AmpPlayer!
var ampMediaAnalytics: AmpMediaAnalyticsManager!
And it’s time to instantiate them now, in your
// Instantiate player
self.ampPlayer = AmpPlayer(parentView: self.view)
self.ampPlayer.autoplay = true
// Register yourself as an observer if required
// Define your desired dimensions, these are some test ones:
let customDimensions = [
"playerId": "AKAM AVPlayer playerId",
"device": "AKAM AVPlayer device",
"show": "AKAM AVPlayer$show"
// Instantiate the Media Analytics Manager
self.ampMA = AmpMediaAnalyticsManager(ampPlayer: self.ampPlayer, configUrl: analyticsUrl, customDimensions: customDimensions)
// Afterwards, let's ask our `ampPlayer` to handle our stream
And that’s basically it, with just those few steps, you have a working integration between AMP and Media Analytics.