Query language

The query language allows you to enter sophisticated object selection criteria, apply various conditions to the field values, and combine them using boolean operators.

How to form a query

Enter your query in the search bar at the bottom of any Commander tab.

A simple search term consists of three parts:

= Field Operator Value

For example, the query:

 = text ~ flight 

shows all ads containing the word flight in the Text column.

Start entering your search term following the = symbol. When you do this, the icon appears in the search bar. You can choose field and operator names from the popups.

When entering field names and values, please keep in mind:

  • The input is not case sensitive.

  • If the field name or value consists of multiple words separated by spaces, enclose it in inverted commas:

    = "Title 1" = "Space travel"
  • If you need to find a substring that itself contains inverted commas, use the \ character:

    = "Title 1" = " \"Space travel\""
  • If you want to specify multiple values, use square brackets:

    = "Title 1" = ["space"; " flight"]

    or

    = "Title 1" = [space flight]
  • If a field can contain a fixed set of values (Display scope, Moderation, Status, Priority, etc.), then use operators ~ and !~ with square brackets, even if the field can contain only a single value.

If the search term was not correctly formulated, then the icon in the text entry line will change to and an error message will appear.

Requests containing multiple conditions

You can use the & (boolean AND) and | (boolean OR) operators to make combined queries.

Search term operations are executed strictly from left to right, but the order can be changed by using round brackets. Operations enclosed in brackets take priority over the standard order of operations.

Example 1
= Keyword ~ ticket | Keyword ~ hotel

This query returns keywords containing the words ticket or hotel.

Example 2
= Keyword ~ ticket | Keyword ~ hotel & Bid > 1

This search term will return keywords that meet two conditions simultaneously:

  1. Contains the word ticket or hotel.
  2. Has a bid on search greater than 1.
Example 3
= Keyword ~ ticket | (Keyword ~ hotel & Bid > 1)

This search term will return keywords that meet at least one of the two conditions:

  1. Contains the word ticket.
  2. Contains the word hotel and has a bid on search greater than 1.

Query language operators

Operator Value Example Result
~ Contains = "Display region" ~ austr Selects ad groups with the Display region field containing Australia or Austria (and maybe some other regions also)
= "Image" ~ [black white] Selects ads with the Image field containing black or white as a substring
= "Display scope" ~ [Ad networks] Selects campaigns that have the Ad networks value in the Display scope field
!~ Doesn't contain = "Display region" !~ austr Selects ad groups with the Display region field not containing Australia and Austria
= Keyword !~ [ticket hotel] Selects keywords with the Keyword field not containing the substrings ticket and hotel
= Moderation !~ [Pending] Selects ads where the Moderation column contains any value except Pending.
= Equal/match = "Display region" = Australia Selects only groups that have Display region set to Australia
= Number = [111111 222222] Selects ads with the numbers 111111 and 222222.
!= Not equal/don't match = "Display region" != Australia Selects groups that have Display region different from Australia
= Number != [111111 222222] Selects all numbers except 111111 and 222222.
> More = ctr > 0.5 Selects keywords with a CTR higher than 0.5
< Less = ctr < 0.5 Selects keywords with a CTR less than 0.5
>= More than or equal to = Bid >= 1 Selects keywords that have a bid on search greater than or equal to 1
<= Less than or equal to = Bid <= 1 Selects keywords that have a bid on search that is less than or equal to 1
& Boolean “AND” in complex search terms = Text ~ flight & Image = space Selects ads with text containing the flight substring, and an image name containing the space substring
| Boolean “OR” in complex search terms = Text ~ space | Text ~ flight Selects ads with text containing the space substring OR flight substring
Attention.

The operators ~, !~ can't be used for columns with numeric values.

The operators >, >=, <, and = can only be used for columns with numeric values.