Skip to content

Conversation

@cmonfortep
Copy link
Contributor

@cmonfortep cmonfortep commented Nov 20, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1212002979565345?focus=true

Description

Updates logic to decide if we should add origin in our attributed metrics.
This now relies on remote config.
if enabled, we validate if origin includes specific substrings, otherwise we don't include.

Steps to test this PR

Update the PrivacyFeatureName PRIVACY_REMOTE_CONFIG_URL with https://duckduckgo.github.io/privacy-configuration/pr-4110/v4/android-config.json

Use logcat filter package:mine message~:"attributed_metric"

Feature 1

  • Fresh install (removing local folder)
  • Launch and wait for Skip onboarding to appear.
  • skip onboarding
  • Go to internal Attribute Metrics
  • Add search events, add ad clicks, add duck ai events
  • update app retention atb and search atb with random values
  • Update origin with funnel_paid_test
  • put install date in the past, 1mo works
  • restart (fire button)
  • you should see some pixels from attributed metrics, they should contain origin

Feature 2

  • Go to internal Attribute Metrics
  • update app retention atb and search atb with NEW random values
  • Update origin with funnel_test
  • restart (fire button)
  • you should see some pixels from attributed metrics, even if ignored, they should contain install_date now

UI changes

Before After
!(Upload before screenshot) (Upload after screenshot)

@cmonfortep
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics/remote_origin_handling branch from b7c5a42 to 55dc96e Compare November 20, 2025 10:37
Copilot finished reviewing on behalf of cmonfortep November 20, 2025 10:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces remote config-based control for including origin parameters in attributed metrics. Instead of always sending the origin when available, the system now validates the origin value against configured substrings before including it in metrics.

Key Changes

  • Introduces OriginParamManager class to encapsulate origin validation logic based on remote config
  • Adds new sendOriginParam feature toggle with configurable substring matching
  • Updates metric emission logic to conditionally include origin or fall back to install_date

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
OriginParamManager.kt New manager class that validates origin values against configured substrings from remote config
SendOriginParamSettings.kt Data class for parsing remote config settings containing origin campaign substrings
OriginParamManagerTest.kt Comprehensive test suite covering all validation scenarios including edge cases
RealAttributedMetricClient.kt Updated to use OriginParamManager for conditional origin inclusion in metrics
RealAttributedMetricClientTest.kt Updated tests to verify behavior with new origin validation logic
AttributedMetricsConfigFeature.kt Added sendOriginParam toggle for remote config control

Copy link
Contributor

@marcosholgado marcosholgado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cmonfortep cmonfortep merged commit 55d4718 into develop Nov 20, 2025
17 checks passed
@cmonfortep cmonfortep deleted the feature/cristian/attributed_metrics/remote_origin_handling branch November 20, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants