Appearance
get_channel
Extracts the marketing channel from campaign name abbreviations.
Signature
sql
get_channel(campaign STRING) RETURNS STRINGParameters
| Parameter | Type | Description |
|---|---|---|
campaign | STRING | The full campaign name string |
Return Value
Returns a STRING representing the marketing channel. This function is not platform-aware because channel abbreviations are consistent across all advertising platforms.
Channel Mappings
| Abbreviation | Channel |
|---|---|
SRCH | Search |
PSOC | Paid Social |
DISP | Display |
NAT | Native |
DOOH | DOOH |
VID | Video |
DGEN | Demand Gen |
PMAX | Performance Max |
YT | YouTube |
BUILD | Display |
If no abbreviation matches, the function returns "Other".
How It Works
The function scans the campaign name for known abbreviations that indicate which advertising channel the campaign belongs to. These abbreviations are typically embedded in a standardized position within the campaign naming convention.
Note that both DISP and BUILD map to "Display" -- BUILD is a legacy abbreviation that has been normalized.
Example
sql
SELECT
CampaignName,
customer_ads_suse.get_channel(CampaignName) AS Channel
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
WHERE Date = '2026-02-01'
LIMIT 5;Sample output:
| CampaignName | Channel |
|---|---|
| SUSE | SRCH | NA | T1 | EN | Linux | SLES | Brand | Search |
| SUSE | PSOC | EMEA | T1 | EN | Cloud Native | Rancher | Paid Social |
| SUSE | DISP | APAC | T2 | EN | AI | MLS | Display |
| SUSE | PMAX | NA | T1 | EN | Linux | SLES | Performance Max |
| SUSE | YT | EMEA | T1 | DE | Cloud Native | Rancher | YouTube |
Usage in Views
sql
-- Filter to only Search campaigns
SELECT *
FROM `paidteam-data-warehouse.customer_ads_suse.google_creative_performance_v2`
WHERE customer_ads_suse.get_channel(CampaignName) = 'Search';