ITADN

Feature request: Google Ads customer entity table

#79857Openjakesciotto 创建于 15 天前
enhancementteam/data-warehousefeature/pipeline-sources
J
jakesciottocommented
<!-- req-ref: 1786124859.443039 --> ## What & why `customer_stats` gives account-level metrics (cost, clicks, impressions, conversions) but there's no dimension table to join them to. Currency, timezone, and auto-tagging status live on the GAQL `customer` resource, and without a dimension table for it, per-account context (which currency an account bills in, its timezone, whether auto-tagging is enabled, its descriptive name) is unavailable to users of the Google Ads data warehouse source. ## Implementation plan - **Research findings**: the GAQL `customer` resource ([fields reference](https://developers.google.com/google-ads/api/fields/v19/overview)) exposes, among others: - `customer.currency_code` — the currency the account bills in - `customer.time_zone` — the account's timezone - `customer.auto_tagging_enabled` — whether auto-tagging (gclid annotation) is on - `customer.descriptive_name` — the human-readable account name - `customer.id` — the account's unique identifier - **Pattern to follow**: `products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/schemas.py` already has dimension-style entries alongside their `_stats` counterparts, e.g. `"campaign"` (line ~359) sits next to `"campaign_stats"` (line ~392), and `"ad"`/`"ad_group"`/`"keyword"`/`"video"` follow the same pairing. A new `"customer"` entry should mirror this shape and sit next to the existing `"customer_stats"` entry (line ~710), reusing `"resource_name": "customer"` but dropping the `segments.date` filter/metrics fields that `customer_stats` carries. - **Concrete steps**: 1. Add a new `"customer"` key to the `RESOURCE_SCHEMAS` (or equivalent) dict in `schemas.py`. 2. `"resource_name": "customer"`. 3. `"primary_key": ["customer.id"]`. 4. `"field_names"`: at minimum `customer.id`, `customer.descriptive_name`, `customer.currency_code`, `customer.time_zone`, `customer.auto_tagging_enabled`. 5. No `filter_field_names` — this is a full-refresh table like `campaign`/`ad_group`, not incremental like the `_stats` tables (small table, changes rarely). 6. Add/update tests in `products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/tests/` covering the new schema entry, following the existing test pattern for dimension tables (e.g. however `campaign` or `ad_group` is covered). 7. Regenerate/update any source-listing docs if the Google Ads source doc enumerates available tables. - **Open questions/risks**: none expected — this is a small, low-risk dimension table addition following an established pattern already used for `campaign`, `ad_group`, `ad`, `keyword`, and `video`.
0 条评论