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 yourbuild.gradle.kts:
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 calladdPermutiveTargeting(), the following targeting parameters are automatically added to your ad request:
1. Reaction Segments (User Cohorts)
User cohorts the user belongs to:permutive.currentCohorts().
2. Contextual Cohorts (v2.2.0+)
Content-based cohorts from the current page (when using PageTracker with URLs):- You’re using PageTracker with URLs
- Contextual data feature is enabled
- Content has been analyzed
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:- Feature enabled - Contact your Customer Success Manager
- URLs provided - Use PageTracker with full URLs
- Content analyzed - Permutive has analyzed the content
Example with Contextual Cohorts
- User cohorts (behavioral segments)
- Contextual cohorts (content-based segments)
Use Cases
News/Content App
E-Commerce App
Ad Loading Best Practices
Load Ads After Page Tracking
For contextual cohorts, load ads after callingtrackPage():
Multiple Ad Units
Reuse the same ad request for multiple ad units:Troubleshooting
No Targeting Parameters in Ad Request
No Targeting Parameters in Ad Request
Problem: Permutive targeting not appearing in ad requests.Causes:
- Not calling
addPermutiveTargeting()orbuildWithPermutiveTargeting() - Permutive not initialized
- No cohorts available yet
- Verify you’re using the correct methods
- Ensure Permutive is initialized before loading ads
- Check
permutive.currentCohorts()returns data - Enable debug logging:
permutive.setDeveloperMode(true)
Contextual Cohorts Not Included
Contextual Cohorts Not Included
Problem: Only user cohorts included, not contextual.Causes:
- Contextual feature not enabled
- Not providing URLs in
trackPage() - Using older add-on version (<2.2.0)
- Content not yet analyzed
- Contact Customer Success Manager to enable feature
- Always provide full URLs to
trackPage() - Update to
google-ads:2.2.0or later - Verify URLs are publicly accessible
AAID Not Captured
AAID Not Captured
Problem: AAID not being set as identity.Cause: AAID provider not configured.Solution: See AAID Provider Guide for setup.
Ads Not Serving
Ads Not Serving
Problem: Ads not displaying.This is not a Permutive SDK issue. Troubleshoot standard Google Ad Manager:
- Verify ad unit ID is correct
- Check ad inventory availability
- Verify Google Mobile Ads SDK setup
- Review Google Ad Manager console
Best Practices
- Do
- Don't
- 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
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
Related Documentation
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 targetingAdManagerAdRequest.Builder.buildWithPermutiveTargeting(permutive: Permutive)- Add targeting and build
Java Utilities
PermutiveAdManagerAdRequestBuilder(permutive: Permutive)- Builder wrapperAdManagerAdRequestUtils.addPermutiveTargeting(builder, permutive)- Static helperAdManagerAdRequestUtils.buildWithPermutiveTargeting(builder, permutive)- Static helper with build
Getting Help
If you encounter issues with Google Ad Manager integration:- Check Troubleshooting Guide
- Verify Google Ads add-on is installed
- Enable debug logging
- Contact your Customer Success Manager