Native App implementation / How to manage consent implementation

Amalie Updated by Amalie

When installing AudienceProject services, it is essential to ensure that a proper integration between various publishers' preferred consent collection methods and the AudienceProject Publisher Script is carried out, to ensure that both Publisher and User consent signals are being respected. The following outlines the most typical scenarios we encounter and draw up a path to proper installation/integration in each case.

For the high level commercial presentation outlining the principles, please read the article titled Publisher Consent Flows.

In the following you will find guides from implementation in two scenarios:

  1. TCF 2.0 platform (or equivalent) - additional logic for loading the publisher script on websites for measurement in case of no consent
  2. Publisher with dynamic cookie consent platform, but no TCF 2.0 (or equivalent) platform

This guide contains the technical implementation details required to work with ‘option 4’ in this guide. 

Introduction

When consent for TCF purposes haven't been collected or granted, special precautions must be taken to ensure the MMF/FIAM measurement continues uninterrupted, but within the scope of the TCF standard.

The typical approach to handling non-consent is often not to communicate with any third parties until proper consent has been collected, avoiding the transfer or collection of any type of potential PID. From a measurement perspective, this approach only works if every Publisher agrees. If some Publishers implement this approach and others not? We will get discrepancies caused by some Publishers including page-views from every-one and others only including page-views from consented users, which leads to a reduction in page views logged.

A solution to this challenge is to implement and run an additional non-PID service in parallel with the consented measurement service. It allows comparable measurement without consensus amongst participants.

The solution outlined in this document allows the measurement of non-consented pageviews by the use of a parallel measurement mechanism. A separate domain that is cookie-less will be used for registering non-consented events.  To ensure no PID is present in the non-consented event-flow, the Apache logs will also be IP anonymized by the removal of the last 3 digits of the IP address in the request.

Consented events will still go through the regular measurement pipeline, while non-consented events will be pushed through the PID-less domain.

If your site runs a TCF 2.0 compatible CMP and you require explicit opt-in (through purposes 1 and 9) to AudienceProject measurement services, you need to explicitly communicate this to the publisher script. This can be done by running the publisher script in “anonymous mode”. 

When the anonymous mode is enabled, all requests to AudienceProject are sent to a special URL and data processing pipeline. Besides that, no cookies will be sent to AudienceProject. 

It is important to note that this method only can be applied to a minority of traffic, since consented traffic/events are still necessary in order to deliver proper measurement.

Native App Implementation via SDK

If your app runs consent management, requiring explicit opt-in to AudienceProject measurement services, you need to explicitly communicate this to the SDK. The setAnonymousTracking function can be used for this purpose. 

When the anonymous tracking setting is enabled, all requests to AudienceProject are sent to a special URL and data processing pipeline. Besides that, no IDFAs will be sent to AudienceProject. 

It is important to note the following: 

  • This method only can be applied to a minority of traffic, since consented traffic/events are still necessary in order to deliver proper measurement
  • This method can not be used in combination with automatic tracking
  • Anonymous tracking is not enabled ( false) by default 

New onboarding subsection for iOS 

Configure the SDK in your iOS App in the following way, if consent is not provided: 

// Configure

UserReport.configure(sakId: "PUBLISHER_ID", mediaId: "MEDIA_ID", anonymousTracking: true)

As soon as the user explicitly provides consent to measurement, call the setAnonymousTracking function to disable  anonymous measurement: UserReport.setAnonymousTracking(false)

New onboarding subsection for Android

Configure the SDK in your Android App in the following way, if consent is not provided: 

import com.audienceproject.userreport.*;

public class App extends Application {

    private UserReport userReport;

    @Override

    public void onCreate() {

        ...

        userReport = UserReport.configure(this, PUBLISHER_ID, MEDIA_ID, true);

    }

    public UserReport getUserReport() {

        return userReport;

    }

}

As soon as the user explicitly provides consent to measurement, call the setAnonymousTracking function to disable anonymous measurement: 

userReport = App.get().getUserReport();

userReport.setAnonymousTracking(false);

New onboarding subsection for ReactNative

Configure the SDK in the following way, if consent is not provided: 

import UserReport from '@apr/react-native-userreport-sdk';

UserReport.setAnonymousTracking(true);

As soon as the user explicitly provides consent to measurement, call the setAnonymousTracking function again to disable anonymous measurement: 

UserReport.setAnonymousTracking(false);

This guide contains the technical implementation details required to work with ‘option 3’ in this guide. 

Note that the implementation in this document does not work when a TCF 2.0 API is present on the page. When working with a TCF 2.0 CMP, please use the guide “TCF 2.0 platform (or equivalent) - Additional logic for loading SAK on websites”.

Cookie-consent is collected from the user arriving on the website or read from a previous engagement. 

If consent is granted, the Publisher script will execute with full permission to perform analytics data collection. The data points sent to AP will be enriched with a hardcoded permission string to ensure the data point only is used according to Media Metric defined purposes.

If there is no cookie consent granted, a special flag will be set when the Publisher script is invoked to ensure we still collect the impression / pageview information, but without being able to read and/or write cookies/identifiers to the user’s device.

Native App implementation via SDK

If your app runs consent management, requiring explicit opt-in to AudienceProject measurement services, you need to explicitly communicate this to the SDK. The setAnonymousTracking function can be used for this purpose. 

When the anonymous tracking setting is enabled, all requests to AudienceProject are sent to a special URL and data processing pipeline. Besides that, no IDFAs will be sent to AudienceProject. 

It is important to note the following: 

  • This method only can be applied to a minority of traffic, since consented traffic/events are still necessary in order to deliver proper measurement
  • This method can not be used in combination with automatic tracking
  • Anonymous tracking is not enabled ( false) by default 

New onboarding subsection for iOS 

Configure the SDK in your iOS App in the following way, if consent is not provided: 

// Configure

UserReport.configure(sakId: "PUBLISHER_ID", mediaId: "MEDIA_ID", anonymousTracking: true)

As soon as the user explicitly provides consent to measurement, call the setAnonymousTracking function to disable  anonymous measurement:UserReport.setAnonymousTracking(false)

New onboarding subsection for Android

Configure the SDK in your Android App in the following way, if consent is not provided: 

import com.audienceproject.userreport.*;

public class App extends Application {

    private UserReport userReport;

    @Override

    public void onCreate() {

        ...

        userReport = UserReport.configure(this, PUBLISHER_ID, MEDIA_ID, true);

    }

    public UserReport getUserReport() {

        return userReport;

    }

}

As soon as the user explicitly provides consent to measurement, call the setAnonymousTracking function to disable anonymous measurement: 

userReport = App.get().getUserReport();

userReport.setAnonymousTracking(false);

How did we do?

In App consent implementation via. Google Tag Manager

React Native implementation / Media & Sections

Contact