Appearance
get_tier
Extracts the market tier designation from a campaign name. Tiers represent the priority or market classification of the targeted countries.
Signature
sql
get_tier(campaign STRING, platform STRING) RETURNS STRINGParameters
| Parameter | Type | Description |
|---|---|---|
campaign | STRING | The full campaign name string |
platform | STRING | The advertising platform (google, microsoft, linkedin, reddit, 6sense, stackadapt) |
Return Value
Returns a STRING with one of the following tier values:
| Value | Description |
|---|---|
T1 | Tier 1 -- highest priority markets |
T2 | Tier 2 -- secondary markets |
T1+2 | Combined Tier 1 and Tier 2 targeting |
T1+2+3 | All tiers combined |
Tier 1 | StackAdapt format (converted from Tier N to TN in some contexts) |
Tier 2 | StackAdapt format |
Unknown | Default when no tier is detected |
Platform-Specific Behavior
Most platforms use the compact T1, T2 format in their campaign names. StackAdapt is the exception, using the longer Tier 1, Tier 2 format.
| Platform | Format | Example |
|---|---|---|
T1, T2, T1+2 | SUSE | SRCH | NA | T1 | EN | ... | |
| Microsoft | T1, T2, T1+2 | SUSE | SRCH | EMEA | T2 | EN | ... |
T1, T2, T1+2 | SUSE | PSOC | NA | T1 | EN | ... | |
T1, T2, T1+2 | Reddit-specific position | |
| 6sense | T1, T2, T1+2 | 6sense-specific position |
| StackAdapt | Tier 1, Tier 2 | StackAdapt uses the longer format |
Example
sql
SELECT
CampaignName,
customer_ads_suse.get_tier(CampaignName, 'google') AS Tier,
SUM(Clicks) AS TotalClicks
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
WHERE Date >= '2026-01-01'
GROUP BY CampaignName, Tier
ORDER BY TotalClicks DESC
LIMIT 10;Sample output:
| CampaignName | Tier | TotalClicks |
|---|---|---|
| SUSE | SRCH | NA | T1 | EN | Linux | SLES | T1 | 4520 |
| SUSE | DISP | EMEA | T1+2 | EN | Cloud Native | Rancher | T1+2 | 3100 |
| SUSE | PSOC | APAC | T2 | EN | AI | MLS | T2 | 1890 |
Tier Distribution Analysis
sql
-- Analyze spend distribution across tiers
SELECT
customer_ads_suse.get_tier(CampaignName, 'microsoft') AS Tier,
COUNT(DISTINCT CampaignName) AS CampaignCount,
SUM(Impressions) AS TotalImpressions,
SUM(Clicks) AS TotalClicks,
SUM(Cost) AS TotalCost
FROM `paidteam-data-warehouse.customer_ads_suse.suse_microsoft_adlevel_final_v2`
WHERE Date >= '2026-01-01'
GROUP BY Tier
ORDER BY TotalCost DESC;