Channel Grouping
Channel grouping definition#
Helper method getSqlDefaultChannelGrouping from includes/helpers.js generates a channel grouping column closed to Google definition. The original Google documentation can be found here
note
The method is inspired by dbt-ga4
You could also skip sessions_with_channel processing step using skipChannelStep method.
Read more about processing steps
Channel grouping mapping#
This is the table with the default channel grouping mapping:
| Source | Medium | Channel |
|---|---|---|
null | null | Direct |
(direct) | (none) or (not set) | Direct |
Matches regex ^(facebook\|instagram\|pinterest\|reddit\|twitter\|linkedin) | Matches regex ^(.*cp.*\|ppc\|retargeting\|paid.*)$ | Paid Social |
SOURCE_CATEGORY_SOCIAL | Matches regex ^(.*cp.*\|ppc\|retargeting\|paid.*)$ | Paid Social |
Matches regex ^(facebook\|instagram\|pinterest\|reddit\|twitter\|linkedin) | - | Organic Social |
| - | "social", "social-network", "social-media", "sm", "social network", "social media" | Organic Social |
SOURCE_CATEGORY_SOCIAL | - | Organic Social |
Matches regex email\|e-mail\|e_mail\|e mail | - | |
| - | Matches regex email\|e-mail\|e_mail\|e mail | |
| - | Matches regex affiliate\|affiliates | Affiliates |
SOURCE_CATEGORY_SHOPPING | Matches regex ^(.*cp.*\|ppc\|paid.*)$ | Paid Shopping |
SOURCE_CATEGORY_VIDEO or dv360_video | Matches regex ^(.*cp.*\|ppc\|paid.*)$ | Paid Video |
dv360_video | - | Paid Video |
dv360_display | - | Display |
| - | Matches regex ^(display\|cpm\|banner)$ | Display |
SOURCE_CATEGORY_SEARCH | Matches regex ^(.*cp.*\|ppc\|retargeting\|paid.*)$ | Paid Search |
| - | Matches regex ^(cpv\|cpa\|cpp\|content-text)$ | Other Advertising |
SOURCE_CATEGORY_SEARCH or organic | - | Organic Search |
| - | Matches regex ^(.*video.*)$ | Organic Video |
SOURCE_CATEGORY_VIDEO | - | Organic Video |
SOURCE_CATEGORY_SHOPPING | - | Organic Shopping |
| - | "referral", "app", "link" | Referral |
| - | audio | Audio |
sms | - | SMS |
| - | sms | SMS |
Matches regex (mobile\|notification\|push$) or firebase | - | Push Notifications |
| Other combinations | Other combinations | (Other) |
This mapping may change in the future.
Source category mapping#
You could check includes/ga4_source_categories.js file (about 900 rows) for mapping between source and source_category and the original Google file could be found here.