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

Adds BYOP and Rewarded Ad impressions to prompt frequency capping flow. #3434

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add byop impression to freq capping events
  • Loading branch information
justinchou-google committed Feb 20, 2024
commit 507ef139feb9edce6513eee31435ce220179d6d1
14 changes: 9 additions & 5 deletions src/runtime/auto-prompt-manager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,19 +775,23 @@ describes.realWin('AutoPromptManager', (env) => {

[
{
storageKey: ImpressionStorageKeys.NEWSLETTER_SIGNUP,
eventType: AnalyticsEvent.IMPRESSION_NEWSLETTER_OPT_IN,
storageKey: ImpressionStorageKeys.NEWSLETTER_SIGNUP,
},
{
eventType: AnalyticsEvent.IMPRESSION_BYOP_NEWSLETTER_OPT_IN,
storageKey: ImpressionStorageKeys.NEWSLETTER_SIGNUP,
},
{
storageKey: ImpressionStorageKeys.REGISTRATION_WALL,
eventType: AnalyticsEvent.IMPRESSION_REGWALL_OPT_IN,
storageKey: ImpressionStorageKeys.REGISTRATION_WALL,
},
{
storageKey: ImpressionStorageKeys.REWARDED_SURVEY,
eventType: AnalyticsEvent.IMPRESSION_SURVEY,
storageKey: ImpressionStorageKeys.REWARDED_SURVEY,
},
].forEach(({storageKey, eventType}) => {
it(`for storageKey=${storageKey} and eventType=${eventType}, should set frequency cap local storage if experiment is enabled`, async () => {
].forEach(({eventType, storageKey}) => {
it(`for eventType=${eventType} and storageKey=${storageKey}, should set frequency cap timestamps via local storage if experiment is enabled`, async () => {
autoPromptManager.frequencyCappingLocalStorageEnabled_ = true;
autoPromptManager.isClosable_ = true;
storageMock
Expand Down
4 changes: 4 additions & 0 deletions src/runtime/auto-prompt-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ const INTERVENTION_TO_STORAGE_KEY_MAP = new Map([
AnalyticsEvent.IMPRESSION_NEWSLETTER_OPT_IN,
ImpressionStorageKeys.NEWSLETTER_SIGNUP,
],
[
AnalyticsEvent.IMPRESSION_BYOP_NEWSLETTER_OPT_IN,
ImpressionStorageKeys.NEWSLETTER_SIGNUP,
],
[
AnalyticsEvent.IMPRESSION_REGWALL_OPT_IN,
ImpressionStorageKeys.REGISTRATION_WALL,
Expand Down