Skip to content

Commit

Permalink
chore(web-analytics): Simplify channel type and reference docs (#21196)
Browse files Browse the repository at this point in the history
* Simply channel type and reference docs

* Fix quotes type
  • Loading branch information
robbie-c authored Mar 28, 2024
1 parent c677074 commit 5138af0
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 5138af0

Please sign in to comment.