Appearance
get_product_line
Determines the product line from a campaign name. This function is platform-aware because different advertising platforms use different campaign naming structures.
Signature
sql
get_product_line(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 product line values:
| Value | Description |
|---|---|
Linux | SUSE Linux Enterprise product family |
Cloud Native | Cloud-native and container management solutions |
AI | Artificial intelligence and machine learning products |
Edge | Edge computing solutions |
Digital Sovereignty | Digital sovereignty and data control solutions |
All | Campaigns targeting multiple product lines or general brand |
Platform-Specific Parsing
The function uses different regex patterns depending on the platform because each platform's campaign naming convention places the product line field in a different position.
| Platform | Parsing Strategy |
|---|---|
| Reddit-specific regex pattern for campaign name structure | |
| Google / Microsoft (Search) | Search-specific pattern based on pipe-delimited naming |
| Display / 6sense | Display and programmatic pattern |
| LinkedIn-specific naming convention | |
| StackAdapt | StackAdapt-specific naming convention |
Example
sql
SELECT
CampaignName,
customer_ads_suse.get_product_line(CampaignName, 'google') AS ProductLine
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
WHERE Date = '2026-02-01'
LIMIT 5;Sample output:
| CampaignName | ProductLine |
|---|---|
| SUSE | SRCH | NA | T1 | EN | Linux | SLES | Brand | Linux |
| SUSE | PSOC | EMEA | T1 | EN | Cloud Native | Rancher | Cloud Native |
| SUSE | DISP | APAC | T2 | EN | AI | MLS | AI |
| SUSE | DISP | NA | T1 | EN | Edge | Edge | Edge |
| SUSE | SRCH | EMEA | T1 | EN | All | General | All |
Cross-Platform Comparison
sql
-- Compare product line distribution across platforms
SELECT
'Google' AS Platform,
customer_ads_suse.get_product_line(CampaignName, 'google') AS ProductLine,
SUM(Impressions) AS TotalImpressions
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
GROUP BY ProductLine
UNION ALL
SELECT
'LinkedIn' AS Platform,
customer_ads_suse.get_product_line(CampaignName, 'linkedin') AS ProductLine,
SUM(Impressions) AS TotalImpressions
FROM `paidteam-data-warehouse.customer_ads_suse.suse_linkedin_adlevel_final_v2`
GROUP BY ProductLine
ORDER BY Platform, TotalImpressions DESC;