Skip to main content

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:

SourceMediumChannel
nullnullDirect
(direct)(none) or (not set)Direct
Matches regex ^(facebook\|instagram\|pinterest\|reddit\|twitter\|linkedin)Matches regex ^(.*cp.*\|ppc\|retargeting\|paid.*)$Paid Social
SOURCE_CATEGORY_SOCIALMatches 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-Email
-Matches regex email\|e-mail\|e_mail\|e mailEmail
-Matches regex affiliate\|affiliatesAffiliates
SOURCE_CATEGORY_SHOPPINGMatches regex ^(.*cp.*\|ppc\|paid.*)$Paid Shopping
SOURCE_CATEGORY_VIDEO or dv360_videoMatches regex ^(.*cp.*\|ppc\|paid.*)$Paid Video
dv360_video-Paid Video
dv360_display-Display
-Matches regex ^(display\|cpm\|banner)$Display
SOURCE_CATEGORY_SEARCHMatches 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
-audioAudio
sms-SMS
-smsSMS
Matches regex (mobile\|notification\|push$) or firebase-Push Notifications
Other combinationsOther 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.