curl --request GET \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting \
--header 'api_key: <api-key>'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting"
headers = {"api_key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {api_key: '<api-key>'}};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting', 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/{campaign_id}/targeting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api_key: <api-key>"
],
]);
$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/{campaign_id}/targeting"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting")
.header("api_key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api_key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"keyword_themes": [
"handmade oak furniture",
"custom dining tables"
],
"excluded_terms": [
"free",
"repair"
],
"targeted_locations": [
{
"name": "San Francisco",
"resourceName": "geoTargetConstants/1014221"
}
],
"excluded_locations": [
{
"name": "Oakland",
"resourceName": "geoTargetConstants/1014044"
}
],
"language_code": "en"
}Get Google Ads campaign targeting
Reads a campaign’s current targeting from Google Ads: the themes it matches, the terms it excludes, and the locations on each side.
This reads Google directly rather than Base44’s copy, so it is the authoritative set to seed an editor from. Send changes back with Update campaign.
Location entries carry a camel-cased resourceName, unlike the rest of this API. A location saved before Base44 recorded display names comes back with its numeric ID as name; nothing repairs that later, so resolve the label through Search locations if you need to show it.
curl --request GET \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting \
--header 'api_key: <api-key>'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting"
headers = {"api_key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {api_key: '<api-key>'}};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting', 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/{campaign_id}/targeting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api_key: <api-key>"
],
]);
$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/{campaign_id}/targeting"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting")
.header("api_key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/targeting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api_key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"keyword_themes": [
"handmade oak furniture",
"custom dining tables"
],
"excluded_terms": [
"free",
"repair"
],
"targeted_locations": [
{
"name": "San Francisco",
"resourceName": "geoTargetConstants/1014221"
}
],
"excluded_locations": [
{
"name": "Oakland",
"resourceName": "geoTargetConstants/1014044"
}
],
"language_code": "en"
}Authorizations
Personal API key.
Path Parameters
ID of the app whose Google Ads campaigns to manage.
Base44's ID for the campaign, as returned in id by List campaigns. This is not the Google Ads campaign ID, which is reported separately as google_campaign_id.
Response
The campaign's live targeting.
What a campaign currently targets, read live from Google.
The themes the campaign matches on.
[
"handmade oak furniture",
"custom dining tables"
]
Search terms the campaign is told not to match.
["free", "repair"]
Locations the campaign targets.
Show child attributes
Show child attributes
[
{
"name": "San Francisco",
"resourceName": "geoTargetConstants/1014221"
}
]
Locations the campaign excludes.
Show child attributes
Show child attributes
[
{
"name": "Oakland",
"resourceName": "geoTargetConstants/1014044"
}
]
Two-letter code for the language the campaign advertises in. Defaults to en when the campaign has none set.
"en"
Was this page helpful?