Skip to main content
This guide covers migrating from Permutive Android SDK v1.9.x to v1.10.x, which introduces contextual cohorts, Dagger dependency injection, and several improvements.
Migration Difficulty: Very Easy | Estimated Time: 15 minutes | Breaking Changes: None

What’s New in v1.10.0

Contextual Cohorts

Content-based segmentation for real-time targeting

Dagger Integration

Internal dependency injection framework (v2.53.1)

Google Ads 2.2.0

Automatic contextual cohort targeting for GAM

AppNexus 1.7.0

Automatic contextual cohort targeting for Xandr
Good news: This release is fully backward compatible with no breaking changes or deprecations.

Migration Steps

1

Update Dependencies

Update your build.gradle.kts or build.gradle:
dependencies {
    implementation("com.permutive.android:core:1.9.8")
    implementation("com.permutive.android:google-ads:2.1.0")
    implementation("com.permutive.android:appnexus:1.6.1")
}
2

Sync and Rebuild

./gradlew clean build
3

Test Your Integration

Your existing code will continue to work without changes. Test to ensure:
  • Events are still being tracked
  • Cohorts are being received
  • Ad targeting is working

Using New Features

Contextual Cohorts

Contextual cohorts are automatically enabled if your workspace has the feature activated. No code changes required!
val activations = permutive.currentActivations

// Get Google Ad Manager contextual cohorts
val gamContextual = activations["dfp_contextual"].orEmpty()

// Get Xandr contextual cohorts
val xandrContextual = activations["appnexus_adserver_contextual"].orEmpty()
If you’re using our add-on libraries, contextual cohorts are automatically included:Google Ad Manager:
// Contextual cohorts automatically added with key "prmtvctx"
val adRequest = AdManagerAdRequest.Builder()
    .addPermutiveTargeting(permutive)
    .build()
Xandr/AppNexus:
// Contextual cohorts automatically added
adView.addPermutiveTargeting(permutive)
See the Contextual Data Guide for full documentation.

Dagger Integration

v1.10.0 introduces Dagger for internal dependency management. This is an internal implementation detail.
No action required. Dagger is used internally by the SDK and doesn’t require any changes to your code.
If your app also uses Dagger and you experience conflicts:
  1. Check your Dagger version matches or is compatible with v2.53.1
  2. Don’t exclude Dagger from the Permutive SDK dependencies:
// Don't do this:
implementation("com.permutive.android:core:1.10.0") {
    exclude(group = "com.google.dagger")  // Will cause issues!
}

Testing Your Migration

Enable debug logging and verify events are still being tracked:
permutive.setDeveloperMode(true)
Look for:
D/Permutive: Published events with names (Pageview) (Accepted: 1 / 1)
Verify behavioral cohorts are still working:
val cohorts = permutive.currentCohorts
Log.d("Migration Test", "Cohorts: ${cohorts.size}")
If contextual is enabled for your workspace:
// Track a page with URL
val pageTracker = permutive.trackPage(
    title = "Test Article",
    url = Uri.parse("https://example.com/test")
)

// Wait a moment for classification
Handler(Looper.getMainLooper()).postDelayed({
    val contextual = permutive.currentActivations["dfp_contextual"]
    Log.d("Migration Test", "Contextual cohorts: $contextual")
}, 2000)
Verify ads are still loading with targeting:
val adRequest = AdManagerAdRequest.Builder()
    .addPermutiveTargeting(permutive)
    .build()

adView.loadAd(adRequest)

// Check logs for:
// D/Permutive: Permutive segments appended to Google Ad request: ...

Rollback

If you need to rollback to v1.9.x:
dependencies {
    implementation("com.permutive.android:core:1.9.8")
    implementation("com.permutive.android:google-ads:2.1.0")
    implementation("com.permutive.android:appnexus:1.6.1")
}
Then sync and rebuild.

Requirements

v1.10.0 maintains the same minimum requirements as v1.9.x:
RequirementVersion
Android API21+ (Android 5.0)
Compile SDK34+
Kotlin1.6+ (if using Kotlin)
Java8+ (JVM target 1.8)

Getting Help