Skip to content

Commit

Permalink
Simply channel type and reference docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Mar 28, 2024
1 parent 68181ad commit 24902a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion posthog/hogql/database/schema/channel_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ 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(
match({campaign}, 'cross-network'),
'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
),
Expand Down

0 comments on commit 24902a1

Please sign in to comment.