Create Google Ads conversion action
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"loginCustomerId": "<string>",
"type": "UPLOAD_CLICKS",
"status": "ENABLED",
"countingType": "ONE_PER_CLICK",
"defaultValue": 1,
"currencyCode": "<string>",
"primaryForGoal": true,
"validateOnly": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions"
payload = {
"name": "<string>",
"loginCustomerId": "<string>",
"type": "UPLOAD_CLICKS",
"status": "ENABLED",
"countingType": "ONE_PER_CLICK",
"defaultValue": 1,
"currencyCode": "<string>",
"primaryForGoal": True,
"validateOnly": True
}
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({
name: '<string>',
loginCustomerId: '<string>',
type: 'UPLOAD_CLICKS',
status: 'ENABLED',
countingType: 'ONE_PER_CLICK',
defaultValue: 1,
currencyCode: '<string>',
primaryForGoal: true,
validateOnly: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions', 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://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions",
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([
'name' => '<string>',
'loginCustomerId' => '<string>',
'type' => 'UPLOAD_CLICKS',
'status' => 'ENABLED',
'countingType' => 'ONE_PER_CLICK',
'defaultValue' => 1,
'currencyCode' => '<string>',
'primaryForGoal' => true,
'validateOnly' => true
]),
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://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"loginCustomerId\": \"<string>\",\n \"type\": \"UPLOAD_CLICKS\",\n \"status\": \"ENABLED\",\n \"countingType\": \"ONE_PER_CLICK\",\n \"defaultValue\": 1,\n \"currencyCode\": \"<string>\",\n \"primaryForGoal\": true,\n \"validateOnly\": true\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://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"loginCustomerId\": \"<string>\",\n \"type\": \"UPLOAD_CLICKS\",\n \"status\": \"ENABLED\",\n \"countingType\": \"ONE_PER_CLICK\",\n \"defaultValue\": 1,\n \"currencyCode\": \"<string>\",\n \"primaryForGoal\": true,\n \"validateOnly\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions")
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 \"name\": \"<string>\",\n \"loginCustomerId\": \"<string>\",\n \"type\": \"UPLOAD_CLICKS\",\n \"status\": \"ENABLED\",\n \"countingType\": \"ONE_PER_CLICK\",\n \"defaultValue\": 1,\n \"currencyCode\": \"<string>\",\n \"primaryForGoal\": true,\n \"validateOnly\": true\n}"
response = http.request(request)
puts response.read_body{
"resourceName": "<string>",
"validateOnly": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Google Ads
Create Google Ads conversion action
Create a conversion action on the customer. Smart Bidding cannot run without an enabled conversion action, and server-side uploads need an UPLOAD_CLICKS action to target. Use validateOnly=true to test the payload without applying it.
POST
/
projects
/
{projectId}
/
google-ads
/
customers
/
{customerId}
/
conversion-actions
Create Google Ads conversion action
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"loginCustomerId": "<string>",
"type": "UPLOAD_CLICKS",
"status": "ENABLED",
"countingType": "ONE_PER_CLICK",
"defaultValue": 1,
"currencyCode": "<string>",
"primaryForGoal": true,
"validateOnly": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions"
payload = {
"name": "<string>",
"loginCustomerId": "<string>",
"type": "UPLOAD_CLICKS",
"status": "ENABLED",
"countingType": "ONE_PER_CLICK",
"defaultValue": 1,
"currencyCode": "<string>",
"primaryForGoal": True,
"validateOnly": True
}
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({
name: '<string>',
loginCustomerId: '<string>',
type: 'UPLOAD_CLICKS',
status: 'ENABLED',
countingType: 'ONE_PER_CLICK',
defaultValue: 1,
currencyCode: '<string>',
primaryForGoal: true,
validateOnly: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions', 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://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions",
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([
'name' => '<string>',
'loginCustomerId' => '<string>',
'type' => 'UPLOAD_CLICKS',
'status' => 'ENABLED',
'countingType' => 'ONE_PER_CLICK',
'defaultValue' => 1,
'currencyCode' => '<string>',
'primaryForGoal' => true,
'validateOnly' => true
]),
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://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"loginCustomerId\": \"<string>\",\n \"type\": \"UPLOAD_CLICKS\",\n \"status\": \"ENABLED\",\n \"countingType\": \"ONE_PER_CLICK\",\n \"defaultValue\": 1,\n \"currencyCode\": \"<string>\",\n \"primaryForGoal\": true,\n \"validateOnly\": true\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://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"loginCustomerId\": \"<string>\",\n \"type\": \"UPLOAD_CLICKS\",\n \"status\": \"ENABLED\",\n \"countingType\": \"ONE_PER_CLICK\",\n \"defaultValue\": 1,\n \"currencyCode\": \"<string>\",\n \"primaryForGoal\": true,\n \"validateOnly\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions")
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 \"name\": \"<string>\",\n \"loginCustomerId\": \"<string>\",\n \"type\": \"UPLOAD_CLICKS\",\n \"status\": \"ENABLED\",\n \"countingType\": \"ONE_PER_CLICK\",\n \"defaultValue\": 1,\n \"currencyCode\": \"<string>\",\n \"primaryForGoal\": true,\n \"validateOnly\": true\n}"
response = http.request(request)
puts response.read_body{
"resourceName": "<string>",
"validateOnly": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Body
application/json
Required string length:
1 - 255Available options:
DEFAULT, PAGE_VIEW, PURCHASE, SIGNUP, DOWNLOAD, ADD_TO_CART, BEGIN_CHECKOUT, SUBSCRIBE_PAID, PHONE_CALL_LEAD, IMPORTED_LEAD, SUBMIT_LEAD_FORM, BOOK_APPOINTMENT, REQUEST_QUOTE, GET_DIRECTIONS, OUTBOUND_CLICK, CONTACT, ENGAGEMENT, QUALIFIED_LEAD, CONVERTED_LEAD Available options:
WEBPAGE, UPLOAD_CLICKS, UPLOAD_CALLS Available options:
ENABLED, HIDDEN Available options:
ONE_PER_CLICK, MANY_PER_CLICK Required range:
x >= 0Required string length:
3