Skip to content

get_channel

Extracts the marketing channel from campaign name abbreviations.

Signature

sql
get_channel(campaign STRING) RETURNS STRING

Parameters

ParameterTypeDescription
campaignSTRINGThe 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

AbbreviationChannel
SRCHSearch
PSOCPaid Social
DISPDisplay
NATNative
DOOHDOOH
VIDVideo
DGENDemand Gen
PMAXPerformance Max
YTYouTube
BUILDDisplay

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:

CampaignNameChannel
SUSE | SRCH | NA | T1 | EN | Linux | SLES | BrandSearch
SUSE | PSOC | EMEA | T1 | EN | Cloud Native | RancherPaid Social
SUSE | DISP | APAC | T2 | EN | AI | MLSDisplay
SUSE | PMAX | NA | T1 | EN | Linux | SLESPerformance Max
SUSE | YT | EMEA | T1 | DE | Cloud Native | RancherYouTube

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';

SUSE Paid Advertising Data Warehouse V2