Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(experiments): tag $experiment_exposure queries as experiments (#78262)

Anders2a20c72ab49d
diff --git a/posthog/clickhouse/query_tagging.py b/posthog/clickhouse/query_tagging.py
index cce41c3edffd..e60d999ed533 100644
--- a/posthog/clickhouse/query_tagging.py
+++ b/posthog/clickhouse/query_tagging.py
@@ -684,6 +684,7 @@ _EVENT_TO_TAGS: tuple[tuple[frozenset[str], FallbackTags], ...] = (
(frozenset({"$exception"}), {"product": Product.ERROR_TRACKING}),
(frozenset({"$web_vitals"}), {"product": Product.WEB_ANALYTICS}),
(frozenset({"$feature_flag_called"}), {"product": Product.FEATURE_FLAGS}),
+ (frozenset({"$experiment_exposure"}), {"product": Product.EXPERIMENTS}),
)
# Union of every event the fallback can match — exposed so HogQLFeatureExtractor can use it as
diff --git a/posthog/clickhouse/test/test_query_tagging.py b/posthog/clickhouse/test/test_query_tagging.py
index 3cc62d33de54..62ede1f91fce 100644
--- a/posthog/clickhouse/test/test_query_tagging.py
+++ b/posthog/clickhouse/test/test_query_tagging.py
@@ -643,6 +643,7 @@ class TestAddFallbackQueryTags(BaseTest):
("exception", ["$exception"], Product.ERROR_TRACKING),
("web_vitals", ["$web_vitals"], Product.WEB_ANALYTICS),
("feature_flag_called", ["$feature_flag_called"], Product.FEATURE_FLAGS),
+ ("experiment_exposure", ["$experiment_exposure"], Product.EXPERIMENTS),
]
)
def test_hogql_features_event_fills_product(self, _name, events, expected_product):