curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"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"
]
}
]Sync Google Ads campaigns
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.
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.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"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"
]
}
]Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app whose Google Ads campaigns to manage.
Response
The campaigns Google reported, as Base44 saved them.
The campaign's ID in Google Ads. Match it against google_campaign_id from List campaigns to find Base44's id for the campaign.
"21098765432"
Name shown for the campaign.
"Spring sale in Berlin"
Serving state Google reports, ENABLED or PAUSED.
"ENABLED"
Campaign type, passed through as Google reports it. Base44 creates SMART and PERFORMANCE_MAX. The other values appear only on campaigns created outside Base44.
"SMART"
Times the campaign's ads were shown.
15420
Clicks the campaign received.
612
Spend in micros of the account currency, where 1,000,000 micros is one unit, so 248000000 is 248.00.
248000000
Conversions Google attributed to the campaign.
31
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.
"REVIEWED"
Google's serving status, passed through as Google reports it.
"SERVING"
Google's summary of whether the campaign is serving well, passed through as Google reports it (ELIGIBLE, LIMITED, NOT_SERVING, …).
"ELIGIBLE"
Google's reasons behind primary_status, for example why a campaign is limited. Empty when there is nothing to explain.
["CAMPAIGN_BUDGET_LIMITED"]
Was this page helpful?