Keyword Logic

Overview

❗️

Keyword logical operators apply to flight-level keywords only.

When writing keyword targeting rules in the UI or sending via the API, please use the below logic.

When using the API, you'll want to include the string under the keyword field when using the Create Flights endpoint, or the ActiveKeywords field using the Create Ads endpoint.

When using the UI, you'll be adding these to the Keyword Targeting section.

📘

Operators only work at flight-level keyword targeting (not ad-level)

Operators

For Keyword Targeting, Kevel uses 'AND', 'OR', and 'NOT'. Formatting for UI and API varies slightly, so see below for the differences.

UI

API

AND

Separate by commas

Separate by commas

OR

Separate lines

Separate with \n. No spaces

NOT

Add ! to start of word

Add ! to start of word

Examples

Target dodge

UI & API

dodge

Target anything not dodge

UI & API

!dodge

Target both dodge AND truck (requires both keywords to be in request)

UI & API

dodge, truck

Target dodge OR truck (requires one of the two to be in request)

UI

API

dodge
truck

dodge\ntruck

Target dodge but not truck (requires dodge, but won't appear if truck is passed)

UI & API

dodge, !truck

❗️

Note that in the above example, this will be considered as ((dodge) AND NOT (truck)). However, a ! at the start of the line will apply to the whole line.

In other words, !a, b, c will be considered as (NOT (a) AND NOT (b) AND NOT (c)).

However, a, !b, c will be considered as ((a) AND NOT (b) AND (c)).

**Target:
(1) dodge and truck
OR (2) dodge and ram

UI

API

dodge, truck
dodge, ram

dodge,truck\ndodge,ram

📘

Using negated keywords in an OR list will negate any queries with that keyword. For example:

fox, bunny
buffalo, cheetah
!sloth

Would be parsed as:

((fox AND bunny) OR (buffalo AND cheetah)) AND (NOT sloth)

This means that an ad will serve when fox and bunny are together in the request, or when buffalo and cheetah are together, but not when sloth is also passed in.