Skip to content

Commit 484d747

Browse files
committed
Add sender for 42 day confirmed/unconfirmed
1 parent ec9303e commit 484d747

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ enum class PirPixel(
169169
PIR_BROKER_CUSTOM_STATS_21DAY_UNCONFIRMED_OPTOUT(
170170
baseName = "dbp_optoutjob_at-21-days_unconfirmed",
171171
type = Count,
172+
),
173+
PIR_BROKER_CUSTOM_STATS_42DAY_CONFIRMED_OPTOUT(
174+
baseName = "dbp_optoutjob_at-42-days_confirmed",
175+
type = Count,
176+
),
177+
178+
PIR_BROKER_CUSTOM_STATS_42DAY_UNCONFIRMED_OPTOUT(
179+
baseName = "dbp_optoutjob_at-42-days_unconfirmed",
180+
type = Count,
172181
), ;
173182

174183
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
@@ -22,6 +22,8 @@ import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_14DAY_CON
2222
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_14DAY_UNCONFIRMED_OPTOUT
2323
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_21DAY_CONFIRMED_OPTOUT
2424
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_21DAY_UNCONFIRMED_OPTOUT
25+
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_42DAY_CONFIRMED_OPTOUT
26+
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_42DAY_UNCONFIRMED_OPTOUT
2527
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_7DAY_CONFIRMED_OPTOUT
2628
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_7DAY_UNCONFIRMED_OPTOUT
2729
import com.duckduckgo.pir.impl.pixels.PirPixel.PIR_BROKER_CUSTOM_STATS_OPTOUT_SUBMIT_SUCCESSRATE
@@ -369,6 +371,16 @@ interface PirPixelSender {
369371
* Emits a pixel when an opt-out is unconfirmed within 21 days.
370372
*/
371373
fun reportBrokerOptOutUnconfirmed21Days(brokerUrl: String)
374+
375+
/**
376+
* Emits a pixel when an opt-out has been confirmed within 42 days.
377+
*/
378+
fun reportBrokerOptOutConfirmed42Days(brokerUrl: String)
379+
380+
/**
381+
* Emits a pixel when an opt-out is unconfirmed within 42 days.
382+
*/
383+
fun reportBrokerOptOutUnconfirmed42Days(brokerUrl: String)
372384
}
373385

374386
@ContributesBinding(AppScope::class)
@@ -711,6 +723,22 @@ class RealPirPixelSender @Inject constructor(
711723
fire(PIR_BROKER_CUSTOM_STATS_21DAY_UNCONFIRMED_OPTOUT, params)
712724
}
713725

726+
override fun reportBrokerOptOutConfirmed42Days(brokerUrl: String) {
727+
val params = mapOf(
728+
PARAM_KEY_BROKER to brokerUrl,
729+
)
730+
731+
fire(PIR_BROKER_CUSTOM_STATS_42DAY_CONFIRMED_OPTOUT, params)
732+
}
733+
734+
override fun reportBrokerOptOutUnconfirmed42Days(brokerUrl: String) {
735+
val params = mapOf(
736+
PARAM_KEY_BROKER to brokerUrl,
737+
)
738+
739+
fire(PIR_BROKER_CUSTOM_STATS_42DAY_UNCONFIRMED_OPTOUT, params)
740+
}
741+
714742
private fun fire(
715743
pixel: PirPixel,
716744
params: Map<String, String> = emptyMap(),

0 commit comments

Comments
 (0)