curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_name": "Order",
"trigger_action": "create",
"conversion_type": "PURCHASE",
"value_field": "total_price",
"currency_field": "currency",
"id_field": "order_number"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings"
payload = {
"entity_name": "Order",
"trigger_action": "create",
"conversion_type": "PURCHASE",
"value_field": "total_price",
"currency_field": "currency",
"id_field": "order_number"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entity_name: 'Order',
trigger_action: 'create',
conversion_type: 'PURCHASE',
value_field: 'total_price',
currency_field: 'currency',
id_field: 'order_number'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings', 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/conversion-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entity_name' => 'Order',
'trigger_action' => 'create',
'conversion_type' => 'PURCHASE',
'value_field' => 'total_price',
'currency_field' => 'currency',
'id_field' => 'order_number'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings"
payload := strings.NewReader("{\n \"entity_name\": \"Order\",\n \"trigger_action\": \"create\",\n \"conversion_type\": \"PURCHASE\",\n \"value_field\": \"total_price\",\n \"currency_field\": \"currency\",\n \"id_field\": \"order_number\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/conversion-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_name\": \"Order\",\n \"trigger_action\": \"create\",\n \"conversion_type\": \"PURCHASE\",\n \"value_field\": \"total_price\",\n \"currency_field\": \"currency\",\n \"id_field\": \"order_number\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_name\": \"Order\",\n \"trigger_action\": \"create\",\n \"conversion_type\": \"PURCHASE\",\n \"value_field\": \"total_price\",\n \"currency_field\": \"currency\",\n \"id_field\": \"order_number\"\n}"
response = http.request(request)
puts response.read_bodyCreate Google Ads conversion mapping
Creates a conversion mapping on one of the app’s Google Ads accounts.
A conversion mapping records that one of the account’s Google Ads goals belongs to an entity write in the app, so Order.create is the app event behind the PURCHASE goal. Base44 reads mappings to decide whether a campaign is ready to launch, and to offer goals in the dashboard.
Point the mapping at a goal in one of two ways. Set conversion_action_id to name a specific goal, or set conversion_type to match whichever goal on the account carries that category. Setting both means the explicit ID wins. Pass the account in the account_id query parameter, and an account belonging to another app returns a 404 even when it sits in the same workspace.
An enabled mapping that resolves to a real goal is what makes Base44 treat the account’s conversion events as configured, which affects Get launch readiness. Send is_enabled as false to record the mapping without that effect.
gtag('event', 'conversion', ...), or you report it from the server with Upload conversions.curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_name": "Order",
"trigger_action": "create",
"conversion_type": "PURCHASE",
"value_field": "total_price",
"currency_field": "currency",
"id_field": "order_number"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings"
payload = {
"entity_name": "Order",
"trigger_action": "create",
"conversion_type": "PURCHASE",
"value_field": "total_price",
"currency_field": "currency",
"id_field": "order_number"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entity_name: 'Order',
trigger_action: 'create',
conversion_type: 'PURCHASE',
value_field: 'total_price',
currency_field: 'currency',
id_field: 'order_number'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings', 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/conversion-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entity_name' => 'Order',
'trigger_action' => 'create',
'conversion_type' => 'PURCHASE',
'value_field' => 'total_price',
'currency_field' => 'currency',
'id_field' => 'order_number'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings"
payload := strings.NewReader("{\n \"entity_name\": \"Order\",\n \"trigger_action\": \"create\",\n \"conversion_type\": \"PURCHASE\",\n \"value_field\": \"total_price\",\n \"currency_field\": \"currency\",\n \"id_field\": \"order_number\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/conversion-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_name\": \"Order\",\n \"trigger_action\": \"create\",\n \"conversion_type\": \"PURCHASE\",\n \"value_field\": \"total_price\",\n \"currency_field\": \"currency\",\n \"id_field\": \"order_number\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/conversion-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_name\": \"Order\",\n \"trigger_action\": \"create\",\n \"conversion_type\": \"PURCHASE\",\n \"value_field\": \"total_price\",\n \"currency_field\": \"currency\",\n \"id_field\": \"order_number\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Scopes
Path Parameters
Query Parameters
ID of the Google Ads account the mapping belongs to, as returned in id by Get Google Ads account. An account belonging to a different app returns a 404.
Body
Google Ads' own ID for the goal to point at, as returned in google_action_id by List conversion actions. Send it alongside conversion_type and this one is matched first, with conversion_type as the fallback if it matches no goal on the account.
"7654321"
Response
The mapping that was created.
A conversion goal tied to an entity write in the app.
Name of the app entity whose write this goal belongs to, as returned by List entity schemas. It is empty on a mapping Base44 created from a conversion it verified firing in the app code, because a client-side conversion has no entity behind it.
"Order"
Google Ads' own ID for the goal this mapping points at, as returned in google_action_id by List conversion actions. Empty when nothing was set for it. A mapping can carry both this and conversion_type, and this one is matched first. If it matches no goal on the account, which happens when the goal was recreated in Google Ads under a new ID, the mapping falls back to matching on conversion_type.
"7654321"
Was this page helpful?