Filtering data

To filter data in the report, use the Filter structure. Each filter consists of a set of criteria for selecting data. Filters are combined with AND, so the report shows data that meets all the filter criteria. A filter consists of three parameters:

  • Field — Which field to compare the values of.

  • Operator — How to compare.

  • Values — An array of symbols to compare with.

For example, to make the report only show rows that have more than 10 conversions, use the filter

"Filter": [{
  "Field": "Conversions",
  "Operator": "GREATER_THAN",
  "Values": ["10"]
}]

The table below shows how operators correspond to fields.

Field name Operators allowed
AdNetworkType EQUALS, IN
CampaignId
CampaignType
AdFormat EQUALS, IN, NOT_EQUALS, NOT_IN
AdGroupId
AdId
Age 1
AudienceTargetId 2
CarrierType
ClickType
CriteriaType
CriterionType
Device
DynamicTextAdTargetId 2
ExternalNetworkName
Gender
LocationOfPresenceId
MatchType
MobilePlatform
Placement
RlAdjustmentId 3
Slot
SmartBannerFilterId 2
TargetingLocationId
Clicks EQUALS, IN, GREATER_THAN, LESS_THAN
Conversions
ImpressionReach
Impressions
AvgClickPosition GREATER_THAN, LESS_THAN
AvgCpc 4
AvgCpm 4
AvgImpressionFrequency
AvgImpressionPosition
AvgPageviews
AvgTrafficVolume
BounceRate
ConversionRate
Cost 4
CostPerConversion 4
Ctr
GoalsRoi
ImpressionShare
Revenue 4
WeightedCtr
WeightedImpressions
Keyword 2 EQUALS, IN, NOT_EQUALS, NOT_IN, STARTS_WITH_IGNORE_CASE, STARTS_WITH_ANY_IGNORE_CASE, DOES_NOT_START_WITH_IGNORE_CASE, DOES_NOT_START_WITH_ALL_IGNORE_CASE
MatchedKeyword
Query

1 Filter by Age

In statistics, the Age field displays the value AGE_45 for periods up through 21.08.2018, and after this date it shows the values AGE_45_54 and AGE_55.

To get statistics for all users age 45 and over regardless of the report period, we recommend specifying all three values in the Age filter:

"Filter": [{
  "Field": "Age",
  "Operator": "IN",
  "Values": ["AGE_45", "AGE_45_54", "AGE_55"]
}]

If not all of these age segments are specified in the filter, the statistics for the period that includes the date 21.08.2018 may be incomplete. For example, if only the values AGE_45_54 and AGE_55 are specified, the report will not include users whose age group is defined as AGE_45.

If the filter specifies AGE_45 and does not specify AGE_45_54 and AGE_55, the report won't be generated for a period after 21.08.2018 and an error message will be returned.

2 Filters for targeting criteria

The following fields aren't output to the report. They are only used for filtering data. These fields are mutually exclusive; only one of them can be present in the Filter array.

Field Description Comment
Keyword The keyword text. The keyword text is shown in the Criterion field in the report, and the keyword ID is shown in the CriterionId field.
AudienceTargetId ID of the audience target. See the section Audience target (AudienceTarget). The ID of the audience target is shown in the CriterionId field. The Criterion field shows the name of the retargeting list.
DynamicTextAdTargetId The ID of the dynamic text ad target, or the ID of the filter for dynamic ads. See the section Ad target for dynamic ads (DynamicTextAdTarget — Webpage) The ID of the dynamic text ad target is shown in the CriterionId field in the report, and the name is shown in the Criterion field.
SmartBannerFilterId The ID of the filter for smart banners. The ID of the smart banner filter is shown in the CriterionId field in the report, and the name is shown in the Criterion field.

3 RlAdjustmentId filter

The RIAdjustmentId filter can have the value NONE, which means that bid adjustments for website users weren't applied.

In particular, if you only want the report to show data with bid adjustments for website users, use this filter:

"Filter": [{
  "Field": "RlAdjustmentId",
  "Operator": "NOT_EQUALS",
  "Values": ["NONE"]
}]

4 Monetary value filters

All monetary values in filters should be specified as integers: the amount in the currency, multiplied by 1,000,000 (regardless of the returnMoneyInMicros: false header).