Skip to content

Conversation

@cmonfortep
Copy link
Contributor

@cmonfortep cmonfortep commented Oct 7, 2025

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

and: https://app.asana.com/1/137249556945/project/488551667048375/task/1211382557175159?focus=true

Description

Introduces 2 attributed metrics and their initial implementation.

Steps to test this PR

While testing this PR you need to add the following in your logcat filter:
tag~:"AttributedMetrics"

Note: Test cases should be executed in order

Not enough data

  • We need fresh install (including removing DDG folder in file system)
  • Open the app
  • wait until "skip onboarding" appears
  • After downloading privacy config and atb init, you should see Client status running: true -> isActive: true, isEnabled: true
  • Skip onboarding, and go to the browser
  • Go to settings -> Attributed Metrics Dev Settings
  • Update app retention atb with v502-1 (and click save)
  • Update search atb with v502-1 (and click save)
  • Update installation date with 10-8d ago (and click save)
  • Go back to the browser
  • Perform a search
  • No pixels are emitted, SearchCount7d: Skip emitting, atb not changed

Sending data

  • Go to settings -> Attributed Metrics Dev Settings
  • Click on "Add Search Events"
  • Update app retention atb with v502-1 (and click save)
  • Update search atb with v502-1 (and click save)
  • Go back to the browser
  • Perform a NEW search
  • Ensure you see Fired pixel user_average_searches_past_week_first_month with params {count=0} (Note: 0 is the bucket, not value. Notice first_month in pixel name)
  • Close the app, open it again (or fire button)
  • Ensure you see Fired pixel user_active_past_week with params {days=2}(note: 2 is the bucket, not the value)

Trigger only if search atb refreshes

  • Perform a new search
  • No pixels are emitted, SearchCount7d: Skip emitting, atb not changed
  • You should see 2 collected events (both ddg_search_days and ddg_search)

Trigger only if app retention atb refreshes

  • Close app, open it again (or fire button)
  • No pixel emitted, SearchDays: Skip emitting atb not changed)

installation >1mo ago

  • Go to settings -> Attributed Metrics Dev Settings
  • Update app retention atb with v402-1 (and click save)
  • Update search atb with v402-1 (and click save)
  • Update installation date with some day in August (and click save)
  • Perform a new search
  • Ensure you see Fired pixel user_average_searches_past_week with params {count=0} (Note: 0 is the bucket, not value. Notice this is not first_month)
  • Close app, open it again (or fire button)
  • Ensure you see Fired pixel user_active_past_week with params {days=2}(note: 2 is the bucket, not the value)

Client not active

  • Clear storage
  • Open the app
  • After downloading privacy config and atb init, you should see Client status running: false -> isActive: false, isEnabled: true
  • Skip onboarding, and go to the browser
  • Perform a search
  • Ensure nothing collected Discard collect event....client not active

UI changes

Before After
!(Upload before screenshot) (Upload after screenshot)
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_module branch from 831e0ec to c8c63fb Compare October 7, 2025 18:13
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from 12d236a to 6a65b73 Compare October 7, 2025 18:13
@cmonfortep cmonfortep changed the base branch from feature/cristian/attributed_metrics_module to feature/cristian/attributed_metrics_internal_dev_settings October 7, 2025 18:13
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from 2106b08 to bedf6b7 Compare October 8, 2025 13:09
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from 6a65b73 to 6129721 Compare October 8, 2025 13:09
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from bedf6b7 to 5fd75af Compare October 8, 2025 13:31
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from 6129721 to 83ab535 Compare October 8, 2025 13:31
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from 5fd75af to 6a6bd27 Compare October 8, 2025 14:52
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch 2 times, most recently from 4738c79 to e0ba965 Compare October 8, 2025 22:04
@cmonfortep cmonfortep marked this pull request as ready for review October 8, 2025 22:08
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch 2 times, most recently from 542fd17 to ec70268 Compare October 9, 2025 10:49
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch 2 times, most recently from 673c16c to 2f3357b Compare October 15, 2025 13:18
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from 6a6bd27 to 56ec903 Compare October 16, 2025 16:52
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from 2f3357b to 28ebece Compare October 16, 2025 16:52
import dagger.SingleInstanceIn
import javax.inject.Inject

@ContributesBinding(AppScope::class)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed this bit on a different PR. "Unrelated"

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 force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch 2 times, most recently from 78547d9 to 5e2e3da Compare October 24, 2025 08:21
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from 28ebece to 90dafbc Compare October 24, 2025 08:22
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from 5e2e3da to b0525e6 Compare October 29, 2025 16:30
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from 90dafbc to a8eb8a7 Compare October 29, 2025 16:30
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from b0525e6 to 78c4bd9 Compare October 31, 2025 11:56
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from a8eb8a7 to efb097e Compare October 31, 2025 11:56
@cmonfortep cmonfortep force-pushed the feature/cristian/attributed_metrics_internal_dev_settings branch from 78c4bd9 to 075c16c Compare November 4, 2025 13:47
@cmonfortep cmonfortep force-pushed the feature/cristian/search_attributed_metric branch from efb097e to 287bc5e Compare November 4, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants