{
  "name": "googleads",
  "display_name": "Google Ads",
  "description": "Use the Google Ads API",
  "group": [
    "transform"
  ],
  "versions": [
    1.0
  ],
  "inputs": 1,
  "outputs": 1,
  "credentials": [
    {
      "name": "googleAdsOAuth2Api",
      "required": true
    }
  ],
  "properties": [
    {
      "name": "resource",
      "display_name": "Resource",
      "kind": "options",
      "required": false,
      "default": "campaign"
    },
    {
      "name": "campaigsNotice",
      "display_name": "Divide field names expressed with <i>micros</i> by 1,000,000 to get the actual value",
      "kind": "notice",
      "required": false,
      "default": ""
    }
  ],
  "source_path": "/home/mcochran/n8n/packages/nodes-base/nodes/Google/Ads/GoogleAds.node.ts",
  "routing": {
    "base_url": "https://googleads.googleapis.com",
    "auth_headers": [],
    "auth_query": [],
    "credential_name": "googleAdsOAuth2Api",
    "operations": [
      {
        "value": "getAll",
        "method": "POST",
        "url": "{{",
        "body": "query:\n\t\t\t\t\t\t\t\t'={{ \"' +\n\t\t\t\t\t\t\t\t'select ' +\n\t\t\t\t\t\t\t\t'campaign.id, ' +\n\t\t\t\t\t\t\t\t'campaign.name, ' +\n\t\t\t\t\t\t\t\t'campaign_budget.amount_micros, ' +\n\t\t\t\t\t\t\t\t'campaign_budget.period,' +\n\t\t\t\t\t\t\t\t'campaign.status,' +\n\t\t\t\t\t\t\t\t'campaign.optimization_score,' +\n\t\t\t\t\t\t\t\t'campaign.advertising_channel_type,' +\n\t\t\t\t\t\t\t\t'campaign.advertising_channel_sub_type,' +\n\t\t\t\t\t\t\t\t'metrics.impressions,' +\n\t\t\t\t\t\t\t\t'metrics.interactions,' +\n\t\t\t\t\t\t\t\t'metrics.interaction_rate,' +\n\t\t\t\t\t\t\t\t'metrics.average_cost,' +\n\t\t\t\t\t\t\t\t'metrics.cost_micros,' +\n\t\t\t\t\t\t\t\t'metrics.conversions,' +\n\t\t\t\t\t\t\t\t'metrics.cost_per_conversion,' +\n\t\t\t\t\t\t\t\t'metrics.conversions_from_interactions_rate,' +\n\t\t\t\t\t\t\t\t'metrics.video_views,' +\n\t\t\t\t\t\t\t\t'metrics.average_cpm,' +\n\t\t\t\t\t\t\t\t'metrics.ctr ' +\n\t\t\t\t\t\t\t\t'from campaign ' +\n\t\t\t\t\t\t\t\t'where campaign.id > 0 ' + // create a dummy where clause so we can append more conditions\n\t\t\t\t\t\t\t\t'\" + ([\"allTime\", undefined, \"\"].includes($parameter.additionalOptions?.dateRange) ? \"\" : \" and segments.date DURING \" + $parameter.additionalOptions.dateRange) + \" ' +\n\t\t\t\t\t\t\t\t'\" + ([\"all\", undefined, \"\"].includes($parameter.additionalOptions?.campaignStatus) ? \"\" : \" and campaign.status = \\'\" + $parameter.additionalOptions.campaignStatus + \"\\'\") + \"' +\n\t\t\t\t\t\t\t\t'\" }}',"
      },
      {
        "value": "get",
        "method": "POST",
        "url": "{{",
        "body": "query:\n\t\t\t\t\t\t\t\t'={{ \"' +\n\t\t\t\t\t\t\t\t'select ' +\n\t\t\t\t\t\t\t\t'campaign.id, ' +\n\t\t\t\t\t\t\t\t'campaign.name, ' +\n\t\t\t\t\t\t\t\t'campaign_budget.amount_micros, ' +\n\t\t\t\t\t\t\t\t'campaign_budget.period,' +\n\t\t\t\t\t\t\t\t'campaign.status,' +\n\t\t\t\t\t\t\t\t'campaign.optimization_score,' +\n\t\t\t\t\t\t\t\t'campaign.advertising_channel_type,' +\n\t\t\t\t\t\t\t\t'campaign.advertising_channel_sub_type,' +\n\t\t\t\t\t\t\t\t'metrics.impressions,' +\n\t\t\t\t\t\t\t\t'metrics.interactions,' +\n\t\t\t\t\t\t\t\t'metrics.interaction_rate,' +\n\t\t\t\t\t\t\t\t'metrics.average_cost,' +\n\t\t\t\t\t\t\t\t'metrics.cost_micros,' +\n\t\t\t\t\t\t\t\t'metrics.conversions,' +\n\t\t\t\t\t\t\t\t'metrics.cost_per_conversion,' +\n\t\t\t\t\t\t\t\t'metrics.conversions_from_interactions_rate,' +\n\t\t\t\t\t\t\t\t'metrics.video_views,' +\n\t\t\t\t\t\t\t\t'metrics.average_cpm,' +\n\t\t\t\t\t\t\t\t'metrics.ctr ' +\n\t\t\t\t\t\t\t\t'from campaign ' +\n\t\t\t\t\t\t\t\t'where campaign.id = \" + $parameter[\"campaignId\"].toString().replace(/-/g, \"\")' +\n\t\t\t\t\t\t\t\t'}}',"
      }
    ],
    "sends": []
  }
}