Appearance
get_geo
Determines the geographic region targeted by a campaign. This function is platform-aware because different platforms encode geography at different positions in the campaign name.
Signature
sql
get_geo(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 geographic region values:
| Value | Description |
|---|---|
NA | North America |
EMEA | Europe, Middle East, and Africa |
APAC | Asia-Pacific |
LATAM | Latin America |
EMEA APAC LATAM | Combined international regions (excludes NA) |
Global | All regions (default when no region is detected) |
Platform-Specific Parsing
Each platform encodes the geographic region at a different position within the campaign name, so platform-specific regex patterns are applied.
| Platform | Parsing Notes |
|---|---|
| Google / Microsoft | Typically the 3rd pipe-delimited segment |
| LinkedIn-specific naming position | |
| Reddit-specific naming position | |
| 6sense | Underscore-delimited naming position |
| StackAdapt | StackAdapt-specific naming position |
Example
sql
SELECT
CampaignName,
customer_ads_suse.get_geo(CampaignName, 'google') AS Geo,
SUM(Impressions) AS TotalImpressions
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
WHERE Date >= '2026-01-01'
GROUP BY CampaignName, Geo
ORDER BY TotalImpressions DESC
LIMIT 10;Sample output:
| CampaignName | Geo | TotalImpressions |
|---|---|---|
| SUSE | SRCH | NA | T1 | EN | Linux | SLES | NA | 125000 |
| SUSE | DISP | EMEA | T1 | EN | Cloud Native | Rancher | EMEA | 98000 |
| SUSE | PSOC | APAC | T2 | EN | AI | MLS | APAC | 67000 |
| SUSE | DISP | EMEA APAC LATAM | T1 | EN | All | EMEA APAC LATAM | 54000 |
Regional Performance Comparison
sql
-- Compare performance across regions
SELECT
customer_ads_suse.get_geo(CampaignName, 'google') AS Geo,
COUNT(DISTINCT CampaignName) AS Campaigns,
SUM(Impressions) AS TotalImpressions,
SUM(Clicks) AS TotalClicks,
SAFE_DIVIDE(SUM(Clicks), SUM(Impressions)) AS CTR
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
WHERE Date >= '2026-01-01'
GROUP BY Geo
ORDER BY TotalImpressions DESC;