From d0c373390ce16965f1562caf519750e555d26ee6 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Wed, 28 May 2025 11:15:35 -0400 Subject: [PATCH 1/3] Make stored-impression lifetime field a duration --- api.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.bs b/api.bs index 321390f..b424af0 100644 --- a/api.bs +++ b/api.bs @@ -860,7 +860,7 @@ The [=impression store=] is a [=set=] of [=impression|impressions=]: or `undefined` if the API was invoked by the [=impression site=]. Conversion Sites: The [=set=] of [=conversion sites=] that were passed to saveImpression(). Timestamp: The time at which saveImpression() was called. -Lifetime: The number of days an [=/impression=] remains eligible for attribution, either from the call to saveImpression(), or a [=/user agent=]-defined limit. +Lifetime: The [=duration=] an [=/impression=] remains eligible for attribution, either from the call to saveImpression(), or a [=/user agent=]-defined limit. Histogram Index: The histogram index passed to saveImpression(). From 97e4b3899b3cc952ef616cdc72d724e16bf6be61 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Wed, 28 May 2025 11:21:26 -0400 Subject: [PATCH 2/3] Exclude expired impressions from common matching logic --- api.bs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api.bs b/api.bs index b424af0..563859f 100644 --- a/api.bs +++ b/api.bs @@ -1414,6 +1414,9 @@ To perform common matching logic, given 1. [=set/iterate|For each=] |impression| in the [=impression store=] for the |epoch|: + 1. If |now| - |impression|'s [=impression/lifetime=] is after |impression|'s + [=impression/timestamp=], [=iteration/continue=]. + 1. If |now| - |lookbackDays| is after |impression|'s [=impression/timestamp=], [=iteration/continue=]. From a972958bc219cd2a589a2240dd3c3bcf5748120b Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Thu, 29 May 2025 08:05:05 -0400 Subject: [PATCH 3/3] Update api.bs Co-authored-by: Martin Thomson --- api.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.bs b/api.bs index 563859f..e99375f 100644 --- a/api.bs +++ b/api.bs @@ -1414,8 +1414,8 @@ To perform common matching logic, given 1. [=set/iterate|For each=] |impression| in the [=impression store=] for the |epoch|: - 1. If |now| - |impression|'s [=impression/lifetime=] is after |impression|'s - [=impression/timestamp=], [=iteration/continue=]. + 1. If |now| is after |impression|'s [=impression/timestamp=] plus |impression|'s + [=impression/lifetime=], [=iteration/continue=]. 1. If |now| - |lookbackDays| is after |impression|'s [=impression/timestamp=], [=iteration/continue=].