Skip to main content
The Google Ads add-on library provides helper methods to automatically add Permutive targeting to Google Ad Manager ad requests, including automatic AAID identification and contextual cohort support.

Installation

Basic Usage

Contextual

Issues

Overview

The Google Ads add-on provides:
  • Automatic targeting - Helper methods for Google Ad Manager
  • AAID identification - Automatic Android Advertising ID capture
  • Contextual cohorts - Automatic content-based targeting (v2.2.0+)
  • Reaction segments - User cohort targeting
  • Simple integration - Minimal code changes required

Installation

Add the Google Ads add-on to your build.gradle.kts:
See Installation Guide for details.

Basic Usage

Adding Permutive Targeting

The add-on provides extension methods for adding Permutive targeting to Google Ad Manager requests:

What Gets Added to Ad Requests

When you call addPermutiveTargeting(), the following targeting parameters are automatically added to your ad request:

1. Reaction Segments (User Cohorts)

User cohorts the user belongs to:
These are retrieved from permutive.currentCohorts().

2. Contextual Cohorts (v2.2.0+)

Content-based cohorts from the current page (when using PageTracker with URLs):
These are automatically included when:
  • You’re using PageTracker with URLs
  • Contextual data feature is enabled
  • Content has been analyzed
See Contextual Data for details.

Complete Integration Example


AAID Integration

The Google Ads add-on automatically provides AAID (Android Advertising ID) functionality. See the AAID Provider Guide for complete documentation on:
  • Setting up AAID identification
  • Required permissions for Android API 31+
  • Privacy considerations
  • Troubleshooting

Contextual Cohorts

Enabling Contextual Cohorts

Contextual cohorts are automatically included (v2.2.0+) when:
  1. Feature enabled - Contact your Customer Success Manager
  2. URLs provided - Use PageTracker with full URLs
  3. Content analyzed - Permutive has analyzed the content

Example with Contextual Cohorts

The ad request will include both:
  • User cohorts (behavioral segments)
  • Contextual cohorts (content-based segments)
See Contextual Data Guide for details.

Use Cases

News/Content App

E-Commerce App


Ad Loading Best Practices

Load Ads After Page Tracking

For contextual cohorts, load ads after calling trackPage():

Multiple Ad Units

Reuse the same ad request for multiple ad units:

Troubleshooting

Problem: Permutive targeting not appearing in ad requests.Causes:
  1. Not calling addPermutiveTargeting() or buildWithPermutiveTargeting()
  2. Permutive not initialized
  3. No cohorts available yet
Solutions:
  1. Verify you’re using the correct methods
  2. Ensure Permutive is initialized before loading ads
  3. Check permutive.currentCohorts() returns data
  4. Enable debug logging: permutive.setDeveloperMode(true)
Problem: Only user cohorts included, not contextual.Causes:
  1. Contextual feature not enabled
  2. Not providing URLs in trackPage()
  3. Using older add-on version (<2.2.0)
  4. Content not yet analyzed
Solutions:
  1. Contact Customer Success Manager to enable feature
  2. Always provide full URLs to trackPage()
  3. Update to google-ads:2.2.0 or later
  4. Verify URLs are publicly accessible
See Contextual Data Troubleshooting.
Problem: AAID not being set as identity.Cause: AAID provider not configured.Solution: See AAID Provider Guide for setup.
Problem: Ads not displaying.This is not a Permutive SDK issue. Troubleshoot standard Google Ad Manager:
  1. Verify ad unit ID is correct
  2. Check ad inventory availability
  3. Verify Google Mobile Ads SDK setup
  4. Review Google Ad Manager console
See Common Errors for more troubleshooting.

Best Practices

  • Call addPermutiveTargeting() on all ad requests
  • Track pages with full URLs for contextual cohorts
  • Load ads after calling trackPage()
  • Use AAID provider for user identification
  • Test targeting in Google Ad Manager console

Version History

v2.2.0 (Latest)

  • ✅ Automatic contextual cohort support
  • ✅ Requires core 1.10.0+
  • ✅ Enhanced ad targeting

v2.1.0

  • Minimum API 23 required
  • Bug fixes and improvements

v2.0.0

  • Updated for Google Mobile Ads SDK 21.0+
  • Breaking changes from Google SDK update
See the Permutive Dashboard for the latest release information.

Migration Notes

Upgrading to v2.2.0

No code changes required! Contextual cohorts are automatically included if:
  • Feature is enabled by Permutive
  • You’re using PageTracker with URLs

AAID Provider

Automatic AAID identification

Contextual Data

Content-based targeting

Page Tracking

Track pages for contextual cohorts

Cohorts and Activations

Understanding segments

Installation

Add-on installation

Issues

Solve common issues

API Reference

For complete API documentation, see the Javadocs.

Kotlin Extensions

  • AdManagerAdRequest.Builder.addPermutiveTargeting(permutive: Permutive) - Add targeting
  • AdManagerAdRequest.Builder.buildWithPermutiveTargeting(permutive: Permutive) - Add targeting and build

Java Utilities

  • PermutiveAdManagerAdRequestBuilder(permutive: Permutive) - Builder wrapper
  • AdManagerAdRequestUtils.addPermutiveTargeting(builder, permutive) - Static helper
  • AdManagerAdRequestUtils.buildWithPermutiveTargeting(builder, permutive) - Static helper with build

Getting Help

If you encounter issues with Google Ad Manager integration:
  1. Check Troubleshooting Guide
  2. Verify Google Ads add-on is installed
  3. Enable debug logging
  4. Contact your Customer Success Manager
For Google Ad Manager issues unrelated to Permutive, consult Google’s documentation.