iOS App implementation / Media & Sections

Amalie Updated by Amalie

iOS implementation

These instructions cover the implementation of your Publisher script in your application. For the Media Metrics Finland measurement solution we use the UserReport SDK.

The UserReport SDK targets iOS 9.0+ and requires Xcode 9.0+ with the purpose of measuring traffic and performing surveys (optional).

Installation

The UserReport SDK can be installed in various ways.

  1. Using CocoaPods
  2. Manually

Using CocoaPods

CocoaPods is a centralized dependency manager for Objective-C and Swift.

Manually

To install it manually drag the SDK into your app project in Xcode or add it as a git submodule. 

In your project folder enter:

Configuration

Configure the SDK using your Publisher ID and your Media ID.

Your Publisher ID and Media ID's are found by following the guides in the Where to find your measurement script and identifiers article.

Screen tracking

Every time a user is navigated to a new screen in the application this needs to be registered with UserReport.trackScreenView() invocation. Depending on your application architecture it may be in different places. Below you can find the most simple example in which every view appearance is measured as a new screen view.

Section tracking

Sections allow you to measure and report usage/traffic at a more granular level across your different media properties. Sections could be “News” and “Sports” which are associated with each pageview logged. Every section has an unique ID. You can find your unique section IDs in the appendix at the end of this document. The section taxonomy in the appendix is a standard defined by Media Metrics.

Whenever a new screen appears that can be associated with a section this needs to be registered by invoking UserReport.trackScreenView() followed by an invocation of UserReport.trackSectionScreenView(sectionId).

The sectionId parameter needs to be one of the predefined Section ID’s outlined in the appendix. And it needs to be determined by code depending on displayed content.

How did we do?

React Native implementation / Media & Sections

Contact