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 ),