Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Mage ai Mage ai Google Ads Campaigns Schema

From Leeroopedia


Knowledge Sources
Domains Data_Integration, Google_Ads, Schema
Last Updated 2026-02-09 00:00 GMT

Overview

JSON Schema definition for Google Ads campaign records used by the Singer-based Google Ads source connector.

Description

The campaigns.json schema file defines the complete data structure for Google Ads campaign entities as consumed by the tap_google_ads Singer-based source connector within Mage Integrations. At 858 lines, this schema covers all campaign-level configuration, bidding strategies, targeting settings, and associated metadata.

The schema is typed as ["null", "object"] at the top level and defines the following key properties:

Scalar properties (simple types):

  • accessibleBiddingStrategy -- string reference to the accessible bidding strategy
  • adServingOptimizationStatus -- string enum for ad serving optimization
  • advertisingChannelSubType -- string sub-type of the advertising channel
  • advertisingChannelType -- string type of advertising channel (Search, Display, Video, etc.)
  • baseCampaign -- string reference to the base campaign for experiments
  • biddingStrategy -- string reference to the bidding strategy resource
  • biddingStrategyType -- string enum for the bidding strategy type
  • campaignBudget -- string reference to the campaign budget resource
  • experimentType -- string campaign experiment type
  • finalUrlSuffix -- string suffix appended to final URLs
  • id -- integer unique identifier for the campaign
  • name -- string name of the campaign
  • optimizationScore -- string (format: singer.decimal) optimization score
  • paymentMode -- string payment mode for the campaign
  • resourceName -- string Google Ads API resource name
  • servingStatus -- string current serving status
  • status -- string campaign status (ENABLED, PAUSED, REMOVED)

Date properties:

  • endDate -- string (format: date-time) campaign end date
  • startDate -- string (format: date-time) campaign start date

Array properties:

  • excludedParentAssetFieldTypes -- array of strings for excluded parent asset field types
  • frequencyCaps -- array of FrequencyCapEntry objects
  • labels -- array of strings for campaign labels

Bidding strategy sub-objects (via $ref definitions):

  • commission -- Commission
  • manualCpc -- ManualCpc
  • manualCpm -- ManualCpm
  • manualCpv -- ManualCpv
  • maximizeConversionValue -- MaximizeConversionValue
  • maximizeConversions -- MaximizeConversions
  • percentCpc -- PercentCpc
  • targetCpa -- TargetCpa
  • targetCpm -- TargetCpm
  • targetImpressionShare -- TargetImpressionShare
  • targetRoas -- TargetRoas

Campaign setting sub-objects (via $ref definitions):

  • appCampaignSetting -- AppCampaignSetting
  • dynamicSearchAdsSetting -- DynamicSearchAdsSetting
  • geoTargetTypeSetting -- GeoTargetTypeSetting
  • hotelSetting -- HotelSettingInfo
  • localCampaignSetting -- LocalCampaignSetting
  • networkSettings -- NetworkSettings
  • optimizationGoalSetting -- OptimizationGoalSetting
  • realTimeBiddingSetting -- RealTimeBiddingSetting
  • selectiveOptimization -- SelectiveOptimization
  • shoppingSetting -- ShoppingSetting

The definitions section includes detailed sub-schemas for each bidding strategy, campaign setting type, and nested structures.

Usage

This schema is automatically loaded by the Google Ads source connector during stream discovery. It is read from disk by the Source.load_schemas_from_folder() method and used to define the Singer catalog entry for the campaigns stream.

Code Reference

Source Location

  • Repository: mage-ai
  • File: mage_integrations/mage_integrations/sources/google_ads/tap_google_ads/schemas/campaigns.json
  • Lines: 1-858

Signature

{
  "type": ["null", "object"],
  "properties": {
    "accessibleBiddingStrategy": { "type": ["null", "string"] },
    "adServingOptimizationStatus": { "type": ["null", "string"] },
    "advertisingChannelSubType": { "type": ["null", "string"] },
    "advertisingChannelType": { "type": ["null", "string"] },
    "appCampaignSetting": { "$ref": "#/definitions/AppCampaignSetting" },
    "baseCampaign": { "type": ["null", "string"] },
    "biddingStrategy": { "type": ["null", "string"] },
    "biddingStrategyType": { "type": ["null", "string"] },
    "campaignBudget": { "type": ["null", "string"] },
    "commission": { "$ref": "#/definitions/Commission" },
    "dynamicSearchAdsSetting": { "$ref": "#/definitions/DynamicSearchAdsSetting" },
    "endDate": { "type": ["null", "string"], "format": "date-time" },
    "excludedParentAssetFieldTypes": { "type": ["null", "array"] },
    "experimentType": { "type": ["null", "string"] },
    "frequencyCaps": { "type": ["null", "array"], "items": { "$ref": "#/definitions/FrequencyCapEntry" } },
    "geoTargetTypeSetting": { "$ref": "#/definitions/GeoTargetTypeSetting" },
    "hotelSetting": { "$ref": "#/definitions/HotelSettingInfo" },
    "id": { "type": ["null", "integer"] },
    "labels": { "type": ["null", "array"] },
    "manualCpc": { "$ref": "#/definitions/ManualCpc" },
    "manualCpm": { "$ref": "#/definitions/ManualCpm" },
    "manualCpv": { "$ref": "#/definitions/ManualCpv" },
    "maximizeConversionValue": { "$ref": "#/definitions/MaximizeConversionValue" },
    "maximizeConversions": { "$ref": "#/definitions/MaximizeConversions" },
    "name": { "type": ["null", "string"] },
    "networkSettings": { "$ref": "#/definitions/NetworkSettings" },
    "optimizationGoalSetting": { "$ref": "#/definitions/OptimizationGoalSetting" },
    "optimizationScore": { "type": ["null", "string"], "format": "singer.decimal" },
    "paymentMode": { "type": ["null", "string"] },
    "percentCpc": { "$ref": "#/definitions/PercentCpc" },
    "realTimeBiddingSetting": { "$ref": "#/definitions/RealTimeBiddingSetting" },
    "resourceName": { "type": ["null", "string"] },
    "selectiveOptimization": { "$ref": "#/definitions/SelectiveOptimization" },
    "servingStatus": { "type": ["null", "string"] },
    "shoppingSetting": { "$ref": "#/definitions/ShoppingSetting" },
    "startDate": { "type": ["null", "string"], "format": "date-time" },
    "status": { "type": ["null", "string"] },
    "targetCpa": { "$ref": "#/definitions/TargetCpa" },
    "targetCpm": { "$ref": "#/definitions/TargetCpm" },
    "targetImpressionShare": { "$ref": "#/definitions/TargetImpressionShare" },
    "targetRoas": { "$ref": "#/definitions/TargetRoas" }
  },
  "definitions": {
    "Commission": { "type": ["null", "object"], "properties": { "..." : "..." } },
    "FrequencyCapEntry": { "type": ["null", "object"], "properties": { "..." : "..." } }
    // ... additional bidding strategy and setting definitions
  }
}

Import

# Loaded automatically by Source.load_schemas_from_folder()
# The schema file is discovered by convention from the schemas/ directory

I/O Contract

Inputs

Name Type Required Description
(none) JSON file Yes Loaded from disk by the schema loader during stream discovery

Outputs

Name Type Description
schema dict JSON Schema object defining property names, types (null, string, integer, array, object), format constraints (date-time, singer.decimal), and $ref definitions for all Google Ads campaign settings and bidding strategies

Usage Examples

import json

schema_path = "mage_integrations/mage_integrations/sources/google_ads/tap_google_ads/schemas/campaigns.json"
with open(schema_path) as f:
    schema = json.load(f)

# List top-level properties
print(list(schema["properties"].keys())[:10])
# ['accessibleBiddingStrategy', 'adServingOptimizationStatus',
#  'advertisingChannelSubType', 'advertisingChannelType',
#  'appCampaignSetting', 'baseCampaign', 'biddingStrategy',
#  'biddingStrategyType', 'campaignBudget', 'commission']

# Check date fields with format constraints
for prop, defn in schema["properties"].items():
    if isinstance(defn, dict) and defn.get("format") == "date-time":
        print(f"{prop}: format=date-time")
# endDate: format=date-time
# startDate: format=date-time

# List all bidding strategy definitions
print(list(schema.get("definitions", {}).keys())[:5])
# ['Commission', 'DynamicSearchAdsSetting', 'FrequencyCapEntry', ...]

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment