Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBP: Implement event pixels #2408

Merged
merged 4 commits into from
Mar 17, 2024
Merged

Conversation

jotaemepereira
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1199230911884351/1206656675196362/f
Tech Design URL:
CC:

Description:
Implements the event pixels defined here: https://app.asana.com/0/0/1206366823020815/f

I’m adding add new four Pixels that are contained inside the DataBrokerProtectionEventPixels class.

Weekly Report Scanning

Pixel name: dbp.event.weekly-report.scanning
Params
had_new_match: User had at least one new match (yes/no)
had_re-appearance: User had at least one re-appearance (previously-removed item reappeared) (yes/no)
scan_coverage: % of all brokers scanned that week (0-25%, 25-50%, 50-75% or 75-100%)

Weekly Report Removals

Pixel name: dbp.event.weekly-report.removals
Params
removals: Number of removals completed that week

Scanning events

Pixel name: dbp.event.scanning-events.new-match - Fire a pixel for each new match (record) found
Pixel name: dbp.event.scanning-events.re-appearance - Fire a pixel for each re-appearance found

Steps to test this PR:

Test the weekly pixels

  1. Run this code (if you bump into the Pixel not firing) because maybe it was fired in the first run. You can clear user defaults in that case and go to Debug -> PIR -> Operations -> (Run scans or opt-outs)
  2. Check that both weekly Pixels are being fired (if you have data in the past, check that it matches by using the database browser)

Test the new match found pixel

  1. Run this code with a new profile where you know there are going to be matches
  2. Check that dbp.event.scanning-events.new-match is fired when a new match is found

Test the re-appearance pixel

This one is harder to test because we need to mimic a record that was found and removed, and then the record was added again by the broker. To do this, find a new match and mark it as removed (even was not removed), then do a scan and it should be marked as re appearance then check the dbp.event.scanning-events.new-match is firedfound

@jotaemepereira jotaemepereira force-pushed the juan/dbp/implement-kpi-event-pixels branch from 2558f4e to 4cf20fe Compare March 13, 2024 18:48
@jotaemepereira jotaemepereira requested a review from Bunn March 13, 2024 18:48
@jotaemepereira jotaemepereira force-pushed the juan/dbp/implement-kpi-event-pixels branch 4 times, most recently from 1be3664 to d5ee333 Compare March 14, 2024 20:12
Copy link
Contributor

github-actions bot commented Mar 14, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 7d0dc46

Copy link
Collaborator

@Bunn Bunn left a comment

Choose a reason for hiding this comment

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

LGTM.

Small comment related to user defaults.
FYI: most tests I did was changing the code to force the paths I wanted to test.

@jotaemepereira jotaemepereira force-pushed the juan/dbp/implement-kpi-event-pixels branch from feb98e4 to 7d0dc46 Compare March 17, 2024 16:38
@jotaemepereira jotaemepereira merged commit 5d7b4bc into main Mar 17, 2024
17 checks passed
@jotaemepereira jotaemepereira deleted the juan/dbp/implement-kpi-event-pixels branch March 17, 2024 16:50
samsymons added a commit that referenced this pull request Mar 18, 2024
# By Juan Manuel Pereira (4) and others
# Via GitHub
* main:
  Improves VPN pixel info and adds tests (#2434)
  DBP: Implement event pixels (#2408)
  Bump BSK (#2435)
  Bump version to 1.80.0 (145)
  Fix syntax in Asana actions
  Bump version to 1.80.0 (144)
  Set marketing version to 1.80.0
  Update embedded files
  DBP: Debug scan model implementation (#2421)
  Roll back CPM post-rollout cleanup (#2430)
  Password Import: Ignore Excluded Sites When Importing from Chrome (#2404)
  Stub objects for Bookmarks DB (#2418)
  Properly handle edge cases (#2417)
  DBP: Treat 404 as failure instead of error (#2426)
  DBP: Use url instead of name to identify brokers on pixels (#2423)
  Fix determining if internal release should be automatically bumped

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
samsymons added a commit that referenced this pull request Mar 18, 2024
# By Dax the Duck (5) and others
# Via GitHub (2) and Chris Brind (1)
* main: (30 commits)
  Update wireguard-apple to 1.1.3 (#2428)
  Improves VPN pixel info and adds tests (#2434)
  DBP: Implement event pixels (#2408)
  Bump BSK (#2435)
  Bump version to 1.80.0 (145)
  Fix syntax in Asana actions
  Bump version to 1.80.0 (144)
  Set marketing version to 1.80.0
  Update embedded files
  DBP: Debug scan model implementation (#2421)
  Roll back CPM post-rollout cleanup (#2430)
  Password Import: Ignore Excluded Sites When Importing from Chrome (#2404)
  Stub objects for Bookmarks DB (#2418)
  Properly handle edge cases (#2417)
  DBP: Treat 404 as failure instead of error (#2426)
  DBP: Use url instead of name to identify brokers on pixels (#2423)
  Fix determining if internal release should be automatically bumped
  Renamed some pixel parameters to be more clear (#2402)
  Update broker json (#2407)
  bump bsk to fix retain cycle (#2425)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
samsymons added a commit that referenced this pull request Mar 19, 2024
* main:
  Remove hardcoded NetP staging endpoint (#2446)
  DBP: Make webview non-persistent and delete any old cache data (#2445)
  Prevents the tunnel from starting without an auth token (#2438)
  Use History in Suggestions on iOS (#2339)
  When publishing a DMG, only check out the branch if it exists, otherwise stay on main
  Bump version to 1.80.0 (146)
  Update wireguard-apple to 1.1.3 (#2428)
  Improves VPN pixel info and adds tests (#2434)
  Update autoconsent to v10.3.0 (#2433)
  DBP: Implement event pixels (#2408)
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