Sync Google Ads campaigns

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Reads the account's campaigns from Google Ads now, saves them to Base44, and returns what Google reported.

For each campaign it reads, Base44 replaces its own record of the name, status, type, daily budget, and serving and policy status with Google's. A campaign on the account that Base44 has no record of, such as one created outside Base44, is added. Deleted campaigns are skipped.

Base44 already refreshes campaign statuses and metrics from Google in the background about once an hour, and that refresh never adds a campaign Base44 doesn't know about. Call this when you need Google's current state right away, or to bring in campaigns created outside Base44.

The rows carry google_campaign_id but not Base44's id. To act on a campaign afterwards, find its id in List campaigns. The metrics are not limited to a date range. Use Get campaign metrics for figures over a window.

<Warning>A sync reads at most 50 campaigns, the ones with the most impressions, and there is no pagination. On an account with more campaigns than that, the rest are neither refreshed nor returned, and nothing in the response says so.</Warning>

This keeps working while the workspace is on a billing hold, so the campaigns it owes for can still be refreshed.

This is limited to 6 requests a minute per app. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

post/api/apps/{app_id}/google-ads/campaigns/sync

Path parameters

app_idstring required

ID of the app whose Google Ads campaigns to manage.

ID of the app whose Google Ads campaigns to manage.

Response

The campaigns Google reported, as Base44 saved them.

google_campaign_idstring required

The campaign's ID in Google Ads. Match it against google_campaign_id from List campaigns to find Base44's id for the campaign.

namestring required

Name shown for the campaign.

statusstring required

Serving state Google reports, ENABLED or PAUSED.

campaign_typestring required

Campaign type, passed through as Google reports it. Base44 creates SMART and PERFORMANCE_MAX. The other values appear only on campaigns created outside Base44.

impressionsinteger required

Times the campaign's ads were shown.

clicksinteger required

Clicks the campaign received.

cost_microsinteger required

Spend in micros of the account currency, where 1,000,000 micros is one unit, so 248000000 is 248.00.

conversionsnumber required

Conversions Google attributed to the campaign.

review_statusstring required

Google's policy review status as Base44 last recorded it (REVIEWED, UNDER_REVIEW, …). A sync doesn't refresh it, and it's empty on a campaign the sync just added.

serving_statusstring required

Google's serving status, passed through as Google reports it.

primary_statusstring required

Google's summary of whether the campaign is serving well, passed through as Google reports it (ELIGIBLE, LIMITED, NOT_SERVING, …).

primary_status_reasonsstring[] required

Google's reasons behind primary_status, for example why a campaign is limited. Empty when there is nothing to explain.

Example response

[
  {
    "google_campaign_id": "21098765432",
    "name": "Spring sale in Berlin",
    "status": "ENABLED",
    "campaign_type": "SMART",
    "impressions": 15420,
    "clicks": 612,
    "cost_micros": 248000000,
    "conversions": 31,
    "review_status": "REVIEWED",
    "serving_status": "SERVING",
    "primary_status": "ELIGIBLE",
    "primary_status_reasons": [
      "CAMPAIGN_BUDGET_LIMITED"
    ]
  }
]

Changes

Changed in 1 of the 33 revisions of this API.1