content: [metrics]
  
  [metrics.amp_avg_cpc]
  data_source = "admarketplace"
  select_expression = "AVG(avg_pub_cpc)"
  friendly_name = "Average Publisher CPC"
  description = "Average cost per click (paid to Mozilla, in USD). Calculated as CPC payout divided by valid clicks."
  
  [metrics.amp_revenue]
  data_source = "admarketplace"
  select_expression = "SUM(revenue)"
  friendly_name = "Revenue"
  description = "Total amount paid to Mozilla in USD."
  
  [metrics.amp_valid_clicks]
  data_source = "admarketplace"
  select_expression = "SUM(valid_clicks)"
  friendly_name = "Total Valid Clicks"
  description = "Total number of valid clicks recorded."
  
  [metrics.amp_valid_impressions]
  data_source = "admarketplace"
  select_expression = "SUM(valid_impressions)"
  friendly_name = "Total Valid Impressions"
  description = "Total number of valid impressions recorded."
  
  [metrics.amp_cpc_rate]
  data_source = "admarketplace"
  select_expression = "SAFE_DIVIDE(SUM(revenue), SUM(valid_clicks))"
  friendly_name = "CPC Rate"
  description = "Calculated as total payout divided by the number of valid clicks. Returns NULL if number of billed clicks is zero."
  
  [metrics.amp_revenue_per_thousand_impressions]
  data_source = "admarketplace"
  select_expression = "SAFE_DIVIDE(SUM(revenue), SUM(valid_impressions)) * 1000"
  friendly_name = "Revenue Per Thousand Impressions"
  description = "RPM Payout divided by the number of valid impressions times 1000. Returns NULL if number of valid impressions is zero."
  
  ### data_sources.ad_metrics_daily
  [metrics.ad_metrics_ad_impressions]
  select_expression = "SUM(impressions)"
  data_source = "ad_metrics_daily"
  type = "scalar"
  friendly_name = "Ad Impressions"
  description = "Ad impressions"
  
  [metrics.ad_metrics_ad_clicks]
  select_expression = "SUM(clicks)"
  data_source = "ad_metrics_daily"
  type = "scalar"
  friendly_name = "Ad Clicks"
  description = "Ad clicks"
  
  [metrics.revenue]
  select_expression = "SUM(revenue)"
  data_source = "ad_metrics_daily"
  type = "scalar"
  friendly_name = "Revenue"
  description = "Ad revenue"
  
  [metrics.milli_impressions]
  select_expression = "SUM(impressions)/1000"
  data_source = "ad_metrics_daily"
  friendly_name = "Milli Impressions"
  description = "Impressions in thousands"
  
  [data_sources]
  
  [data_sources.admarketplace]
  from_expression = "mozdata.ads.admarketplace"
  client_id_column = "advertiser"
  friendly_name = "AdMarketplace"
  description = "Data source for AdMarketplace metrics. Includes dimensions such as advertiser, device, country, and more."
  submission_date_column = "adm_date"
  
  [data_sources.ad_metrics_daily]
  from_expression = "mozdata.ads.ad_metrics_daily"
  friendly_name = "Ad Metrics Daily"
  descriptions = """
    Daily ad metrics, at the ad_id level. Joined to ad provider metadata to
    pull in additional fields (including pricing and total revenue)
  """
  columns_as_dimensions = true 
  submission_date_column = "submission_date"
  client_id_column = "NULL"
  
  [data_sources.countries]
  from_expression = "mozdata.static.country_codes_v1"
  client_id_column = "code"
  friendly_name = "Countries"
  description = "Countries"
  columns_as_dimensions = true
  submission_date_column = "NULL"
  
  [data_sources.ad_metrics_daily.joins.countries]
  relationship = "one_to_many"
  on_expression = "ad_metrics_daily.country = countries.code"
  
  [dimensions]
  
  [dimensions.adm_date]
  data_source = "admarketplace"
  select_expression = "adm_date"
  friendly_name = "Report Date"
  description = "Date field from the adM report. Not the date the report was sent to us from adM."
  
  [dimensions.amp_created_date]
  data_source = "admarketplace"
  select_expression = "metadata.created_at"
  friendly_name = "Ingestion Date"
  description = "Date field created upon Ingestion."
  
  [dimensions.amp_advertiser]
  data_source = "admarketplace"
  select_expression = "advertiser"
  friendly_name = "Advertiser"
  description = "The advertiser associated with the data."
  
  [dimensions.amp_country_code]
  data_source = "admarketplace"
  select_expression = "country_code"
  friendly_name = "Country Code"
  description = "Two-letter country code following the ISO 3166-1 alpha-2 standard."
  
  [dimensions.amp_country_name]
  data_source = "admarketplace"
  select_expression = "country_name"
  friendly_name = "Country Name"
  description = "Name of the country the ad was displayed in."
  
  [dimensions.amp_surface]
  data_source = "admarketplace"
  select_expression = "surface"
  friendly_name = "Surface"
  description = "Device type from which the ad interaction originated."
  
  [dimensions.amp_partner_name]
  data_source = "admarketplace"
  select_expression = "partner_name"
  friendly_name = "Partner Name"
  description = "Name of the partner associated with the ad data."
  
  [dimensions.amp_product]
  data_source = "admarketplace"
  select_expression = "product"
  friendly_name = "Product"
  description = "Product category or type associated with the ad displayed."
  
  [dimensions.amp_pricing_model]
  data_source = "admarketplace"
  select_expression = "pricing_model"
  friendly_name = "Pricing Model"
  description = "Pricing model used for billing the ad interaction, e.g., CPC (Cost Per Click) or RPM (Revenue Per Mille)."
  
  [dimensions.amp_position]
  data_source = "admarketplace"
  select_expression = "position"
  friendly_name = "Ad Position"
  description = "Position in which the content was shown."
  