Skip to content

Commit 4b9ed49

Browse files
committed
Add sender for 21 day confirmed/unconfirmed
1 parent ea7efae commit 4b9ed49

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

pir/pir-impl/src/main/java/com/duckduckgo/pir/impl/pixels/PirPixel.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ enum class PirPixel(
159159
PIR_BROKER_CUSTOM_STATS_14DAY_UNCONFIRMED_OPTOUT(
160160
baseName = "dbp_optoutjob_at-14-days_unconfirmed",
161161
type = Count,
162+
),
163+
164+
PIR_BROKER_CUSTOM_STATS_21DAY_CONFIRMED_OPTOUT(
165+
baseName = "dbp_optoutjob_at-21-days_confirmed",
166+
type = Count,
167+
),
168+
169+
PIR_BROKER_CUSTOM_STATS_21DAY_UNCONFIRMED_OPTOUT(
170+
baseName = "dbp_optoutjob_at-21-days_unconfirmed",
171+
type = Count,
162172
), ;
163173

164174
constructor(

pir/pir-impl/src/main/java/com/duckduckgo/pir/impl/pixels/PirPixelSender.kt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import com.duckduckgo.app.statistics.pixels.Pixel
2020
import com.duckduckgo.di.scopes.AppScope
2121
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_14DAY_CONFIRMED_OPTOUT
2222
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_14DAY_UNCONFIRMED_OPTOUT
23+
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_21DAY_CONFIRMED_OPTOUT
24+
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_21DAY_UNCONFIRMED_OPTOUT
2325
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_7DAY_CONFIRMED_OPTOUT
2426
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_7DAY_UNCONFIRMED_OPTOUT
2527
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_OPTOUT_SUBMIT_SUCCESSRATE
@@ -357,6 +359,16 @@ interface PirPixelSender {
357359
* Emits a pixel when an opt-out is unconfirmed within 14 days.
358360
*/
359361
fun reportBrokerOptOutUnconfirmed14Days(brokerUrl: String)
362+
363+
/**
364+
* Emits a pixel when an opt-out has been confirmed within 21 days.
365+
*/
366+
fun reportBrokerOptOutConfirmed21Days(brokerUrl: String)
367+
368+
/**
369+
* Emits a pixel when an opt-out is unconfirmed within 21 days.
370+
*/
371+
fun reportBrokerOptOutUnconfirmed21Days(brokerUrl: String)
360372
}
361373

362374
@ContributesBinding(AppScope::class)
@@ -683,6 +695,22 @@ class RealPirPixelSender @Inject constructor(
683695
fire(PIR_BROKER_CUSTOM_STATS_14DAY_UNCONFIRMED_OPTOUT, params)
684696
}
685697

698+
override fun reportBrokerOptOutConfirmed21Days(brokerUrl: String) {
699+
val params = mapOf(
700+
PARAM_KEY_BROKER to brokerUrl,
701+
)
702+
703+
fire(PIR_BROKER_CUSTOM_STATS_21DAY_CONFIRMED_OPTOUT, params)
704+
}
705+
706+
override fun reportBrokerOptOutUnconfirmed21Days(brokerUrl: String) {
707+
val params = mapOf(
708+
PARAM_KEY_BROKER to brokerUrl,
709+
)
710+
711+
fire(PIR_BROKER_CUSTOM_STATS_21DAY_UNCONFIRMED_OPTOUT, params)
712+
}
713+
686714
private fun fire(
687715
pixel: PirPixel,
688716
params: Map<String, String> = emptyMap(),

0 commit comments

Comments
 (0)