From f1e6f1c44f7fa3449e731d267d716a8702b16a61 Mon Sep 17 00:00:00 2001 From: matst80 Date: Tue, 11 Aug 2026 15:32:41 +0200 Subject: [PATCH] tracking: promotion view/click event types + storefront beacons (submodule bumps backoffice, slask-tracking) --- event/event.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/event/event.go b/event/event.go index 7b1aa91..1e4cf17 100644 --- a/event/event.go +++ b/event/event.go @@ -81,6 +81,17 @@ const ( // 5 hand-written `pevent.Type("track.purchase")` literals with this // typed constant. TrackPurchase Type = "track.purchase" + // TrackPromotionView / TrackPromotionClick — storefront promotion + // attribution. Producer: the storefront promotion-badge islands, PLP + // promo badges, bundle picker and cart bundle upsell (lib/track.ts + // beacons → POST /api/track/promotion). Consumer: slask-tracking + // (pkg/view PromoStats) — per-promotion view/click counters for the + // promotions admin. Payload is the wire PromotionEvent (promotion id, + // action, placement, optional item id). These ride the browser beacon + // path only (no AMQP producer today), so they stay out of the + // `track.*` RabbitMQ routing pattern by construction. + TrackPromotionView Type = "track.promotion_view" + TrackPromotionClick Type = "track.promotion_click" // Newsletter campaign attribution (review 3.8). Producer: the order // service's MailerSend webhook receiver (cmd/order/newsletter-webhook.go) @@ -196,6 +207,11 @@ var KnownTypes = []Type{ TrackSession, TrackSearch, TrackClick, TrackCart, TrackPurchase, TrackImpression, TrackAction, TrackPageView, TrackPageEngaged, TrackPageAction, TrackExperiment, + TrackPromotionView, TrackPromotionClick, + // Track* constants without a browser beacon: consumed over AMQP only, + // but the drift-guard test requires every declared Track* constant to + // appear here so the HTTP ?event_types= surface stays exhaustive. + TrackCampaignOpen, TrackCampaignClick, } // IsKnownType reports whether s matches one of the declared Track*