tracking: promotion view/click event types + storefront beacons (submodule bumps backoffice, slask-tracking)

This commit is contained in:
mats committed 2026-08-11 15:32:41 +02:00
1 parent 4aa9c91bc7
commit f1e6f1c44f
1 file changed
+16
+16
View File
@@ -81,6 +81,17 @@ const (
// 5 hand-written `pevent.Type("track.purchase")` literals with this // 5 hand-written `pevent.Type("track.purchase")` literals with this
// typed constant. // typed constant.
TrackPurchase Type = "track.purchase" 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 // Newsletter campaign attribution (review 3.8). Producer: the order
// service's MailerSend webhook receiver (cmd/order/newsletter-webhook.go) // service's MailerSend webhook receiver (cmd/order/newsletter-webhook.go)
@@ -196,6 +207,11 @@ var KnownTypes = []Type{
TrackSession, TrackSearch, TrackClick, TrackCart, TrackPurchase, TrackSession, TrackSearch, TrackClick, TrackCart, TrackPurchase,
TrackImpression, TrackAction, TrackPageView, TrackPageEngaged, TrackImpression, TrackAction, TrackPageView, TrackPageEngaged,
TrackPageAction, TrackExperiment, 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* // IsKnownType reports whether s matches one of the declared Track*