Akamai Media Analytics
The AmpMediaAnalytics plugin offers a quick way to integrate AmpPlayer with Akamai Media Analytics. This plugin enables the reporting of the Media Analytics beacons througout each playback session.
If you desire to check out a basic implementation please refer to our application samples:
To manually install the plugin you’ll need to download our latest distribution. You’ll have to look for the
AmpMediaAnalytics.framework and the
AmpCore.framework. You will also need the Akamai Media Analytics for iOS, you can download it on the iOS release page.
For tvOS you should include the
AmpCoreTV.framework and the
AmpMediaAnalyticsTV.framework. The Akamai Media Analytics for tvOS will be required as well, you can download it on the tvOS release page.
|The latest version of the Akamai Media Analytics used by this plugin is 3.23 on iOS . Newer versions may be used, but you may run into unexpected errors until an update is released.|
After aquiring the frameworks you can just drag them to you Xcode project directory.
The last step, is to mark every imported framework for
Embed & Sign in the project’s general tab.
If you don’t have CocoaPods installed, refer to the CocoaPods documentation. To use CocoaPods, first create a Podfile in the directory containing the Xcode project. For the AmpMediaAnalytics plugin, the Podfile should look like this:
target "ProjectName" do use_frameworks! pod 'AmpCore' pod 'AmpMediaAnalytics' end
Once you have added the Podfile just run the command
pod install --repo-update in the directory it’s located. Once the command has been completed you should se a new
.xcworkspace file in your folder. Now you can start integrating the library.
You need a working implementation of the AmpPlayer before using this plugin. If you need the implementation guide for AmpPlayer please refer to our documentation.
The first step is to import the AmpCore and AmpMediaAnalytics plugins.
import AmpCore import AmpMediaAnalytics
To use this plugin you should first initialize it. You need to specify the player being used as well as the Akamai Media Analytics configuration beacon XML URL.
var ampMediaAnalyticsManager:AmpMediaAnalyticsManager! ampMediaAnalyticsManager = AmpMediaAnalyticsManager( ampPlayer: ampPlayer, configurationUrl: analyticsUrl)
|The configuration beacon XML URL is provided by Akamai.|
You can also have customized data (dimensions) included in the events reported by AmpMediaAnalytics, you achieve this by defining a dictionary with the
dimension: value pairs and passing it on when initializing the
AmpMediaAnalyticsManager. This is a sample implementation:
let customDimensions = [ "title": "Your Title", "category": "Your Category", "playerId": "Player ID", "device": "device", "show": "Your Show" ] ampMediaAnalyticsManager = AmpMediaAnalyticsManager( ampPlayer: ampPlayer, configurationUrl: analyticsUrl, dimensions: customDimensions)
This guide was written on 5/6/2020 and it’s last revision was made on 5/6/2020. If you need any additional support please contact us through our offical support email.