Google Play Privacy Sandbox implementation and measurement

Following Apple’s SKAdNetwork update, Google has been aggressively working towards implementing their Privacy Sandbox on Android. Though it's still under development, there have been several additions already that focus on implementing marketing metrics tracking in a privacy-friendly way.

Do check out our detailed guide on Google Play Privacy Sandbox to learn more.

Now let's move towards understanding the implementation process, but keep in mind that Privacy Sandbox on Android currently offers Developer Preview and Beta programs. This means that features might change or become unstable in the future. Be sure to check the official release notes regularly to stay updated with any changes.

Implementing Google Play Privacy Sandbox

Here's a simplified overview with basic code examples (make sure to adjust these according to the official documentation):

Add dependencies (Gradle)

Include the necessary libraries in your module-level <build.gradle> file.

dependencies {
implementation "com.google.android.gms:play-services-ads-identifier:21.5.0" // Example (version may change)
// Add other necessary Privacy Sandbox dependencies here as they become available
implementation "com.google.android.gms:play-services-ads:22.4.0" // Ads SDK (Important!)
}

SDK runtime

The new SDK runtime will be available for apps and games running on the Android 14 environment. To understand backward compatibility, refer to the official documentation here. The SDK Runtime will allow third-party SDKs to run separately from the app, offering better protection for user data.

Setting up the SDK Runtime for Privacy Sandbox involves multiple steps, which may vary depending on the specific case. For detailed instructions, follow the official setup guide.

Attribution Reporting API

The Attribution Reporting API helps measure how effective ad campaigns are while keeping data private.

// (Conceptual Example - adapt based on official documentation)
// This is a placeholder; consult official documentation for the latest API usage.

AttributionManager attributionManager = AttributionManager.getInstance(context);

// Register an impression (when an ad is shown in your game):
AttributionImpressionRequest impressionRequest = AttributionManager.buildImpressionRequest(impressionUri, // other params);
attributionManager.registerImpression(impressionRequest);

// Register a click (when a user interacts with an ad):
AttributionClickRequest clickRequest = AttributionManager.buildClickRequest(clickUri, // other params);
attributionManager.registerClick(clickRequest);

// In-app events (e.g., level completion, purchase):
// Associate in-app events with attribution sources. Refer to official documentation.

// Retrieve attribution reports (details depend on the reporting model). Handle reports according to privacy guidelines.

Topics API

The Topics API is important for interest-based advertising without tracking individual users. It groups apps into general interest “topics,” assigns these topics to users based on their app use, and shares a few topics with advertisers when they request ads. The Google Mobile Ads SDK is likely to manage this process automatically.

// (Conceptual Example - adapt based on official documentation)
// This is a placeholder; consult official documentation for the latest API usage.
TopicsManager topicsManager = TopicsManager.getInstance(context);

// Get the user's top topics.
Task<List<Topic>> topicsTask = topicsManager.getTopics();

topicsTask.addOnCompleteListener(new OnCompleteListener<List<Topic>>() {
@Override
public void onComplete(@NonNull Task<List<Topic>> task) {
if (task.isSuccessful()) {
List<Topic> topics = task.getResult();
// Use the topics for ad targeting (e.g., filtering ad requests).
} else {
// Handle errors
}
}
});

Protected Audience API (if applicable)

The Protected Audience API enables privacy-preserving remarketing and custom audiences. While implementation requires careful design, it allows interest-based advertising without sharing browsing history.

Ads are selected on the user's device, and the Attribution Reporting API handles tracking. Consult the official documentation for detailed implementation instructions.

Note: The Privacy Sandbox is being developed. Always check the official guidelines and best practices. The process and best practices may change. Refer to the official documentation for the latest information

Privacy Sandbox <> Segwise

The Privacy Sandbox on Android helps with app marketing and advertising while focusing on user privacy. However, tracking performance across different ad networks is still crucial for improving your campaigns. This is where Segwise excels.

Segwise is an AI-powered tool that tracks your mobile ad data and alerts you when metrics breach thresholds. It quickly spots problems, saving you money on ads. Think of it as a co-pilot that looks at your advertising data and gives detailed metrics to boost your campaigns.