Overview
Defines all available report fields for Google Ads core streams and report streams used by the Mage Google Ads source connector.
Description
This module is a pure data definition file that declares the selectable fields for each Google Ads stream and report type. It contains two categories of field lists: core stream fields (empty lists serving as placeholders for runtime field discovery) and report stream fields (populated lists of fully qualified Google Ads API field names in resource.field dot notation). The report field lists enumerate customer attributes, metrics (impressions, clicks, conversions, cost, etc.), and segment dimensions (date, device, network type, etc.) for each report type. These definitions are consumed by the Google Ads streams module to build GAQL (Google Ads Query Language) SELECT queries.
Usage
Imported by streams.py to determine which fields are available for selection in each stream's schema and to construct GAQL queries for data extraction.
Code Reference
Source Location
- Repository: mage-ai
- File: mage_integrations/mage_integrations/sources/google_ads/tap_google_ads/report_definitions.py
- Lines: 1-1877
Signature
# Core stream field lists (empty, populated at runtime)
ACCESSIBLE_BIDDING_STRATEGY_FIELDS = []
ACCOUNT_FIELDS = []
AD_GROUP_AD_FIELDS = []
AD_GROUP_CRITERION_FIELDS = []
AD_GROUP_FIELDS = []
# ... (22 core stream field lists total)
# Report stream field lists (populated with API field names)
ACCOUNT_PERFORMANCE_REPORT_FIELDS = ["customer.auto_tagging_enabled", "metrics.clicks", ...]
AD_GROUP_PERFORMANCE_REPORT_FIELDS = [...]
AD_PERFORMANCE_REPORT_FIELDS = [...]
# ... (24 report field lists total)
Import
from mage_integrations.sources.google_ads.tap_google_ads import report_definitions
I/O Contract
Inputs
| Name |
Type |
Required |
Description
|
| N/A |
N/A |
N/A |
This is a data-only module with no function parameters
|
Outputs
| Name |
Type |
Description
|
| *_FIELDS |
list[str] |
Lists of fully qualified Google Ads API field names for each stream/report type
|
Field Categories
Core Stream Fields (22 lists)
| Field List Name |
Description
|
| ACCESSIBLE_BIDDING_STRATEGY_FIELDS |
Bidding strategy resource fields
|
| ACCOUNT_FIELDS |
Customer account resource fields
|
| AD_GROUP_AD_FIELDS |
Ad group ad resource fields
|
| AD_GROUP_CRITERION_FIELDS |
Ad group targeting criterion fields
|
| AD_GROUP_FIELDS |
Ad group resource fields
|
| BIDDING_STRATEGY_FIELDS |
Bidding strategy fields
|
| CALL_VIEW_FIELDS |
Call tracking view fields
|
| CAMPAIGN_BUDGET_FIELDS |
Campaign budget resource fields
|
| CAMPAIGN_CRITERION_FIELDS |
Campaign targeting criterion fields
|
| CAMPAIGN_FIELDS |
Campaign resource fields
|
| CAMPAIGN_LABEL_FIELDS |
Campaign label association fields
|
| CARRIER_CONSTANT_FIELDS |
Mobile carrier constant fields
|
| FEED_FIELDS |
Feed resource fields
|
| FEED_ITEM_FIELDS |
Feed item resource fields
|
| LABEL_FIELDS |
Label resource fields
|
| LANGUAGE_CONSTANT_FIELDS |
Language constant fields
|
| MOBILE_APP_CATEGORY_CONSTANT_FIELDS |
Mobile app category fields
|
| MOBILE_DEVICE_CONSTANT_FIELDS |
Mobile device constant fields
|
| OPERATING_SYSTEM_VERSION_CONSTANT_FIELDS |
OS version constant fields
|
| TOPIC_CONSTANT_FIELDS |
Topic constant fields
|
| USER_INTEREST_FIELDS |
User interest fields
|
| USER_LIST_FIELDS |
User list (audience) fields
|
Report Stream Fields (24 lists)
| Field List Name |
Field Count Category
|
| ACCOUNT_PERFORMANCE_REPORT_FIELDS |
Customer attributes, metrics, segments
|
| AD_GROUP_PERFORMANCE_REPORT_FIELDS |
Ad group attributes, metrics, segments
|
| AD_PERFORMANCE_REPORT_FIELDS |
Ad attributes, metrics, segments
|
| AGE_RANGE_PERFORMANCE_REPORT_FIELDS |
Age range targeting, metrics, segments
|
| AD_GROUP_AUDIENCE_PERFORMANCE_REPORT_FIELDS |
Ad group audience, metrics, segments
|
| CAMPAIGN_AUDIENCE_PERFORMANCE_REPORT_FIELDS |
Campaign audience, metrics, segments
|
| CAMPAIGN_PERFORMANCE_REPORT_FIELDS |
Campaign attributes, metrics, segments
|
| CLICK_PERFORMANCE_REPORT_FIELDS |
Click detail fields (90-day max)
|
| DISPLAY_KEYWORD_PERFORMANCE_REPORT_FIELDS |
Display keyword targeting, metrics
|
| DISPLAY_TOPICS_PERFORMANCE_REPORT_FIELDS |
Display topic targeting, metrics
|
| EXPANDED_LANDING_PAGE_REPORT_FIELDS |
Landing page URL, metrics
|
| GENDER_PERFORMANCE_REPORT_FIELDS |
Gender targeting, metrics, segments
|
| GEO_PERFORMANCE_REPORT_FIELDS |
Geographic performance, metrics
|
| KEYWORDLESS_QUERY_REPORT_FIELDS |
Dynamic search ad query fields
|
| KEYWORDS_PERFORMANCE_REPORT_FIELDS |
Keyword targeting, metrics, segments
|
| LANDING_PAGE_REPORT_FIELDS |
Landing page metrics
|
| PLACEHOLDER_FEED_ITEM_REPORT_FIELDS |
Feed item placeholder metrics
|
| PLACEHOLDER_REPORT_FIELDS |
Placeholder type metrics
|
| PLACEMENT_PERFORMANCE_REPORT_FIELDS |
Managed placement metrics
|
| SEARCH_QUERY_PERFORMANCE_REPORT_FIELDS |
Search term query metrics
|
| SHOPPING_PERFORMANCE_REPORT_FIELDS |
Shopping campaign metrics
|
| USER_LOCATION_PERFORMANCE_REPORT_FIELDS |
User location metrics
|
| VIDEO_PERFORMANCE_REPORT_FIELDS |
Video campaign metrics
|
Usage Examples
from mage_integrations.sources.google_ads.tap_google_ads import report_definitions
# Access field list for a report
fields = report_definitions.ACCOUNT_PERFORMANCE_REPORT_FIELDS
# Returns: ["customer.auto_tagging_enabled", "customer.currency_code", "metrics.clicks", ...]
# Use in GAQL query construction
selected = ["customer.id", "metrics.clicks", "segments.date"]
query = f"SELECT {','.join(selected)} FROM customer"
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.