Skip to content

suse_microsoft_adlevel_final_v2

Full reference: paidteam-data-warehouse.customer_ads_suse.suse_microsoft_adlevel_final_v2Type: Final | Rows: 145,169 | Size: 65.7 MB

Microsoft Ads ad-level final data (V2). Contains the complete historical record of Microsoft Ads performance, refreshed daily from staging via a rolling 60-day DELETE+INSERT process.

Schema

ColumnTypeNullableDescription
DateDATENoDate of ad performance
AccountNameSTRINGYesMicrosoft Ads account name
CampaignIDSTRINGYesMicrosoft Ads campaign ID
AdGroupIDSTRINGYesMicrosoft Ads ad group ID
AdIDSTRINGYesMicrosoft Ads ad ID
CampaignNameSTRINGYesCampaign name
AdGroupNameSTRINGYesAd group name
AdTitleSTRINGYesAd headline / title
CampaignTypeSTRINGYesCampaign type (Search, Audience, etc.)
FinalUrlSTRINGYesFinal destination URL
ImpressionsINTEGERYesNumber of impressions
ClicksINTEGERYesNumber of clicks
CTRFLOATYesClick-through rate
CPCFLOATYesCost per click
CostFLOATYesTotal cost
ConversionsINTEGERYesNumber of conversions
ViewThroughConversionsINTEGERYesView-through conversions
ConversionsRateFLOATYesConversion rate
VideoViewsINTEGERYesNumber of video views
VideoViewsRateINTEGERYesVideo views rate
VideoViews25PercentINTEGERYesVideo watched to 25%
VideoViews50PercentINTEGERYesVideo watched to 50%
VideoViews75PercentINTEGERYesVideo watched to 75%
VideoViews100PercentINTEGERYesVideo watched to 100%
AverageWatchTimeVideoINTEGERYesAverage video watch time (seconds)
_ingested_atTIMESTAMPYesTimestamp when the row was inserted by the refresh script

Partitioning & Clustering

  • Partitioned by: Date (DAY)
  • Partitions: 457
  • Clustered by: CampaignName, AdGroupName

Refresh Logic

The scheduled refresh script performs the following for Microsoft:

  1. Read all rows from suse_microsoft_adlevel_staging_v2
  2. Identify the MIN(Date) and MAX(Date) range in staging
  3. DELETE rows in this final table matching that date range AND the same CampaignID, AdGroupID, AdID combinations
  4. INSERT all staging rows with _ingested_at = CURRENT_TIMESTAMP()
  5. Log the operation to refresh_log_v2

Primary keys used for refresh: Date, CampaignID, AdGroupID, AdID

Sample Query

sql
SELECT
  Date,
  CampaignName,
  CampaignType,
  SUM(Impressions) AS total_impressions,
  SUM(Clicks) AS total_clicks,
  SUM(Cost) AS total_cost,
  SUM(Conversions) AS total_conversions
FROM `paidteam-data-warehouse.customer_ads_suse.suse_microsoft_adlevel_final_v2`
WHERE Date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
GROUP BY Date, CampaignName, CampaignType
ORDER BY Date DESC
LIMIT 100;

Notes

  • VideoViewsRate is currently INTEGER. If Microsoft begins returning decimal values, this column should be altered to FLOAT64 in both staging and final tables simultaneously.
  • The AccountName column is unique to Microsoft among all platforms in this warehouse.
  • Clustering is on CampaignName and AdGroupName (human-readable names, not IDs) to optimize dashboard queries that typically filter by campaign name.

SUSE Paid Advertising Data Warehouse V2