Skip to main content

UID2 IMA Plugin for Android Integration Guide

The UID2 Interactive Media Ads (IMA) Plugin for Android enables publishers that use the Google IMA SDK for Android to send UID2 tokens as secure signals in ad requests from Android apps. This is done automatically, with no direct coding needed from the app developer.

Functionality

This plugin simplifies integration with Google Interactive Media Ads (IMA) for any publishers who want to support UID2 for apps running on Android devices.

Version

This documentation is for the UID2 IMA Plugin for Android version 1.6.0 and later.

GitHub Repository

This plugin is in the following open-source GitHub repository:

Complete UID2 Account Setup and Configure Account

To integrate with UID2, you'll need to have a UID2 account. If you haven't yet created an account, first follow the steps described on the Account Setup page.

When initial account setup is complete, you'll receive instructions and a link to access the UID2 Portal, where you can create your credentials for the production environment and configure additional values, if needed. For details, see Getting Started with the UID2 Portal.

The steps you'll take in the UID2 Portal are different depending on whether your implementation will be client-side, client-server, or server-side. Specific instructions are in each implementation guide. For a summary, see Client-Side or Client-Server Integration?.

Requirements

To run this plugin, install the following:

  1. Google IMA SDK v3.30.3 or later:
  2. SDK for Android v1.6.0 or later:
  3. UID2 IMA Plugin for Android v1.6.0
  4. If you are using R8 or Proguard, add the applicable option specified in Notes for Using R8 or ProGuard

Installation

Prerequisite: Install the Google Interactive Media Ads SDK and the SDK for Android.

Install the UID2 Android IMA Plugin to an existing app with the SDK for Android and Google IMA SDK installed. There are two installation options:

Gradle

To install with Gradle, add the SDK as a dependency in the build.gradle file:

implementation 'com.uid2:uid2-android-sdk-ima:1.6.0'

Maven

To install with Maven, add the SDK as a dependency in the pom.xml file:

<dependency>
<groupId>com.uid2</groupId>
<artifactId>uid2-android-sdk-ima</artifactId>
<version>1.6.0</version>
</dependency>

Notes for Using R8 or ProGuard

If you are using R8, the shrinking and obfuscation rules are included automatically.

If you are using ProGuard, you must manually add the option specified in uid2-ima.pro.