Custom Fields
Overview
Custom fields are custom properties attached to advertisers, campaigns and flights. They act like extensions to your Kevel settings so you can track third-party data about the campaign or flight (from a product management system, your internal billing system, etc.) inside the Kevel app.
For example, you may want to store a SKU code on each campaign.
Custom fields use a JSON schema that defines each field and the data types that are allowed for it. Currently, you must contact support before your schema can be set up. See "Setting Up Custom Fields" below.
You cannot use custom fields without a schema. Contact support to create your schema before attempting to use custom fields in the UI or API.
You can add or change custom field values after advertisers, campaigns or flights have been created.
Custom fields do not enter reporting and cannot influence how a flight is served.
Each Kevel customer can set up to 20 custom fields with a total size of 2000 characters.
Setting Up Custom Fields
Currently, you must contact Kevel support to set up a new custom field. Future releases will enable you to add custom fields directly from the UI.
We need the following for each field to build your schema:
- The field name
- Whether the field is associated with a advertiser, campaign or a flight
- Whether the field is required or optional
- The data type for the field. We currently support numbers, booleans, URLs, and strings
- Whether the data should be entered as a text field or a dropdown. If a dropdown, also send us the valid values
Setting Custom Fields with the API
Follow the instructions in "Setting Up Custom Fields" before you attempt to set fields using the API. Your schema should be in place before setting fields.
For
CustomFieldsJson
, you must supply a valid, escaped JSON string containing values for each of your custom fields. For example, if the only custom field you have is a drop-down box to select SKU values, and one of the possible SKU values is "ROS Sidebar", you can set the SKU of a flight to "ROS Sidebar" like this:"CustomFieldsJson": "{\"SKU\":\"ROS Sidebar\"}"
Using Custom Fields
Your custom fields data must be valid JSON.
After your schema is in place, you can set the value of custom fields through either the UI or the API.
-
In the UI, custom fields will appear on the management page for either the advertiser, campaign or flight.
-
In the API, you can set custom fields with the
CustomFieldsJSON
property on the advertiser, campaign or flight objects. Refer to our Flights API doc for more info.
Custom Fields as Macros
You can insert the values of custom fields in creatives, click URLs and metadata as macros.
For custom fields on the flight, construct the macro as:
{{ad.flight.customFields.codeOfCustomField}}
For custom fields on the campaign, construct the macro as:
{{ad.flight.campaign.customFields.codeOfCustomField}}
For custom fields on the advertiser - coming soon!
The code
parameter for the custom field is found in the JSON used to create the schema in your account. If you aren't sure of the code
, please contact support.
Updated 3 months ago