From 5138af0e69f808ae0bc181738fb7749ef9dac8cd Mon Sep 17 00:00:00 2001 From: Robbie Date: Thu, 28 Mar 2024 16:28:09 +0000 Subject: [PATCH] chore(web-analytics): Simplify channel type and reference docs (#21196) * Simply channel type and reference docs * Fix quotes type --- posthog/hogql/database/schema/channel_type.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posthog/hogql/database/schema/channel_type.py b/posthog/hogql/database/schema/channel_type.py index 1552a0e6aa6d4..24e4d32bab05b 100644 --- a/posthog/hogql/database/schema/channel_type.py +++ b/posthog/hogql/database/schema/channel_type.py @@ -68,6 +68,8 @@ def wrap_with_null_if_empty(expr: ast.Expr) -> ast.Expr: args=[ast.Call(name="nullIf", args=[expr, ast.Constant(value="")]), ast.Constant(value="null")], ) + # This logic is referenced in our docs https://posthog.com/docs/data/channel-type, be sure to update both if you + # update either. return parse_expr( """ multiIf( @@ -75,7 +77,8 @@ def wrap_with_null_if_empty(expr: ast.Expr) -> ast.Expr: 'Cross Network', ( - match({medium}, '^(.*cp.*|ppc|retargeting|paid.*)$') OR + {medium} IN ('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting') OR + startsWith({medium}, 'paid') OR {gclid} IS NOT NULL OR {gad_source} IS NOT NULL ),