Record Conversion
curl --request POST \
--url https://api.embedads.com/advertisers/{advertiserID}/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_name": "<string>",
"value": 123,
"currency": "<string>",
"country": "<string>",
"ip_address": "<string>",
"user_agent": "<string>",
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"zip_code": "<string>",
"event_id": "<string>"
}
'import requests
url = "https://api.embedads.com/advertisers/{advertiserID}/conversions"
payload = {
"event_name": "<string>",
"value": 123,
"currency": "<string>",
"country": "<string>",
"ip_address": "<string>",
"user_agent": "<string>",
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"zip_code": "<string>",
"event_id": "<string>"
}
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({
event_name: '<string>',
value: 123,
currency: '<string>',
country: '<string>',
ip_address: '<string>',
user_agent: '<string>',
email: '<string>',
phone: '<string>',
first_name: '<string>',
last_name: '<string>',
zip_code: '<string>',
event_id: '<string>'
})
};
fetch('https://api.embedads.com/advertisers/{advertiserID}/conversions', 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.embedads.com/advertisers/{advertiserID}/conversions",
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([
'event_name' => '<string>',
'value' => 123,
'currency' => '<string>',
'country' => '<string>',
'ip_address' => '<string>',
'user_agent' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'zip_code' => '<string>',
'event_id' => '<string>'
]),
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.embedads.com/advertisers/{advertiserID}/conversions"
payload := strings.NewReader("{\n \"event_name\": \"<string>\",\n \"value\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"event_id\": \"<string>\"\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.embedads.com/advertisers/{advertiserID}/conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_name\": \"<string>\",\n \"value\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"event_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embedads.com/advertisers/{advertiserID}/conversions")
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 \"event_name\": \"<string>\",\n \"value\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"event_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"events_received": 1,
"success": true
}
{
"error": "Conversion not tracked. It is likely that invalid fields were provided."
}
{
"error": "Internal server error."
}
Advertiser Conversions
Record Conversion
Sends a conversion event to the Advertiser’s Meta pixel (if one exists). This is an alternative to the methods available on the Advertiser’s Settings page in the admin portal.
POST
/
advertisers
/
{advertiserID}
/
conversions
Record Conversion
curl --request POST \
--url https://api.embedads.com/advertisers/{advertiserID}/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_name": "<string>",
"value": 123,
"currency": "<string>",
"country": "<string>",
"ip_address": "<string>",
"user_agent": "<string>",
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"zip_code": "<string>",
"event_id": "<string>"
}
'import requests
url = "https://api.embedads.com/advertisers/{advertiserID}/conversions"
payload = {
"event_name": "<string>",
"value": 123,
"currency": "<string>",
"country": "<string>",
"ip_address": "<string>",
"user_agent": "<string>",
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"zip_code": "<string>",
"event_id": "<string>"
}
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({
event_name: '<string>',
value: 123,
currency: '<string>',
country: '<string>',
ip_address: '<string>',
user_agent: '<string>',
email: '<string>',
phone: '<string>',
first_name: '<string>',
last_name: '<string>',
zip_code: '<string>',
event_id: '<string>'
})
};
fetch('https://api.embedads.com/advertisers/{advertiserID}/conversions', 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.embedads.com/advertisers/{advertiserID}/conversions",
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([
'event_name' => '<string>',
'value' => 123,
'currency' => '<string>',
'country' => '<string>',
'ip_address' => '<string>',
'user_agent' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'zip_code' => '<string>',
'event_id' => '<string>'
]),
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.embedads.com/advertisers/{advertiserID}/conversions"
payload := strings.NewReader("{\n \"event_name\": \"<string>\",\n \"value\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"event_id\": \"<string>\"\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.embedads.com/advertisers/{advertiserID}/conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_name\": \"<string>\",\n \"value\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"event_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embedads.com/advertisers/{advertiserID}/conversions")
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 \"event_name\": \"<string>\",\n \"value\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"event_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"events_received": 1,
"success": true
}
{
"error": "Conversion not tracked. It is likely that invalid fields were provided."
}
{
"error": "Internal server error."
}
We do not store conversion data. We immediately forward it to the Ad Networks, without storing it on our servers.
Do not send data regulated under HIPAA, nor data from minors, non-US persons, or those who have not consented to data sharing.
Path Parameters
The ID of the advertiser.
Body Parameters
The name of the event that triggered the conversion. Should be one of the following:
PurchaseLeadViewContentCompleteRegistrationAddToCartPhoneCall
Value of the conversion. Required if event_name is Purchase
Currency of the conversion. Must be specified as
"USD". Only include this if you include value.A two-letter lowercase country code.
The IP address of the customer.
The user agent of the customer.
The email address of the customer.
The phone number of the customer. Optionally including country code. Formatting is flexible.
The first name of the customer.
The last name of the customer.
The zip code of the customer.
Used to deduplicate events sent within 48 hours of one another. If specified, ensure that it is unique to the event, otherwise conversions may be dropped.
Response
The number of events received.
Whether the conversion was successfully recorded.
{
"events_received": 1,
"success": true
}
{
"error": "Conversion not tracked. It is likely that invalid fields were provided."
}
{
"error": "Internal server error."
}
⌘I