Update tracking codes
curl --request PATCH \
--url https://{your-subdomain}.neetoform.com/api/external/v2/forms/{form_id}/tracking_codes \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"tracking_codes": {
"ga_code": "G-ABC123XYZ",
"gtm_code": "GTM-ABC123",
"pixel_id": "123456789012345"
}
}
'const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tracking_codes: {ga_code: 'G-ABC123XYZ', gtm_code: 'GTM-ABC123', pixel_id: '123456789012345'}
})
};
fetch('https://{your-subdomain}.neetoform.com/api/external/v2/forms/{form_id}/tracking_codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetoform.com/api/external/v2/forms/{form_id}/tracking_codes"
payload = { "tracking_codes": {
"ga_code": "G-ABC123XYZ",
"gtm_code": "GTM-ABC123",
"pixel_id": "123456789012345"
} }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"tracking_codes": {
"ga_code": "G-ABC123XYZ",
"gtm_code": null,
"pixel_id": "123456789012345"
}
}{
"error": "<string>"
}{
"error": "Form does not exist."
}{
"error": "Ga code is invalid"
}Form settings
Update tracking codes
Set or remove tracking IDs. Only the fields you send are changed. Send an empty string to remove an ID. If one ID is not valid, nothing is saved.
PATCH
/
forms
/
{form_id}
/
tracking_codes
Update tracking codes
curl --request PATCH \
--url https://{your-subdomain}.neetoform.com/api/external/v2/forms/{form_id}/tracking_codes \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"tracking_codes": {
"ga_code": "G-ABC123XYZ",
"gtm_code": "GTM-ABC123",
"pixel_id": "123456789012345"
}
}
'const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tracking_codes: {ga_code: 'G-ABC123XYZ', gtm_code: 'GTM-ABC123', pixel_id: '123456789012345'}
})
};
fetch('https://{your-subdomain}.neetoform.com/api/external/v2/forms/{form_id}/tracking_codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetoform.com/api/external/v2/forms/{form_id}/tracking_codes"
payload = { "tracking_codes": {
"ga_code": "G-ABC123XYZ",
"gtm_code": "GTM-ABC123",
"pixel_id": "123456789012345"
} }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"tracking_codes": {
"ga_code": "G-ABC123XYZ",
"gtm_code": null,
"pixel_id": "123456789012345"
}
}{
"error": "<string>"
}{
"error": "Form does not exist."
}{
"error": "Ga code is invalid"
}Replace
Learn how to find your subdomain in Workspace subdomain.
{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Path Parameters
Unique ID of the form. Refer to Getting the Form ID for detailed instructions.
Body
application/json