Skip to content

get_product

Identifies the specific product from a campaign name. This function is platform-aware because different advertising platforms use different campaign naming structures.

Signature

sql
get_product(campaign STRING, platform STRING) RETURNS STRING

Parameters

ParameterTypeDescription
campaignSTRINGThe full campaign name string
platformSTRINGThe advertising platform (google, microsoft, linkedin, reddit, 6sense, stackadapt)

Return Value

Returns a STRING with one of the following product values:

ValueDescription
EdgeSUSE Edge computing solutions
AIGeneral AI solutions
MLSSUSE AI / Machine Learning Service
SLESSUSE Linux Enterprise Server
ECMEnterprise Container Management
RancherRancher by SUSE (container management)
Rancher AWSRancher on AWS marketplace
TelcoTelecommunications-specific solutions
KubernetesKubernetes management solutions
AllMulti-product or general brand campaigns

Platform-Specific Parsing

The product field sits at different positions within each platform's campaign naming convention. The function applies platform-specific regex to extract the correct value.

PlatformNotes
Google / MicrosoftTypically the 7th pipe-delimited segment
LinkedInUses LinkedIn-specific naming structure
RedditReddit-specific position in campaign name
6senseUses underscore-delimited naming
StackAdaptUses underscore-delimited naming

Example

sql
SELECT
  CampaignName,
  customer_ads_suse.get_product(CampaignName, 'linkedin') AS Product
FROM `paidteam-data-warehouse.customer_ads_suse.suse_linkedin_adlevel_final_v2`
WHERE Date = '2026-02-01'
LIMIT 5;

Sample output:

CampaignNameProduct
SUSE | PSOC | NA | T1 | EN | Cloud Native | Rancher | ProspectingRancher
SUSE | PSOC | EMEA | T1 | EN | Linux | SLES | RetargetingSLES
SUSE | PSOC | APAC | T1 | EN | AI | MLS | TOFUMLS
SUSE | PSOC | NA | T1 | EN | Edge | Edge | ProspectingEdge
SUSE | PSOC | EMEA | T1 | EN | Cloud Native | Rancher AWS | MOFURancher AWS

Combining Product Line and Product

sql
-- Get full product hierarchy
SELECT
  CampaignName,
  customer_ads_suse.get_product_line(CampaignName, 'google') AS ProductLine,
  customer_ads_suse.get_product(CampaignName, 'google') AS Product,
  customer_ads_suse.get_subproduct(CampaignName, 'google') AS SubProduct,
  SUM(Clicks) AS TotalClicks
FROM `paidteam-data-warehouse.customer_ads_suse.suse_google_adlevel_final_v2`
WHERE Date >= '2026-01-01'
GROUP BY CampaignName, ProductLine, Product, SubProduct
ORDER BY TotalClicks DESC
LIMIT 20;

SUSE Paid Advertising Data Warehouse V2