Before you start
- Sign in to your workspace with access to edit campaigns (campaign.write), such as the Admin or Editor role.
- Have an active line item with an approved creative.
- To repeat the test, have an API key and two public IP addresses whose countries you know.
Step-by-step guide
-
Add a country rule
Open the line item's Targeting tab. The rules are kept in an audience; if the tab offers Add targeting, choose it first. Choose Add geo rule, set Rule type to Country, enter the country code and choose Save targeting. The sentence at the top says what the line item reaches.
- Rule type
Country - Continent, region and city rules are also available.
- Country (ISO 3166-1)
US - The two-letter code.
- Schedule
Business hours - Or click and drag your own hours on the grid.
- Rule type
-
Test two viewer addresses
The Tags tab's Send a test request sends no viewer address, so use the API: POST to the placement's test-fire path with an ip in the body. An address in the country fills. One outside it answers no ad, and the line item's reason is audience_not_matched. Test requests aren't counted or billed.
-
Set the schedule
Open the Delivery tab. Under Schedule, choose Business hours or click and drag the hours on the grid. The hours follow the line item's time zone, shown above the grid. Choose Save. Outside those hours, the Delivery panel's Held back by says Outside its dayparts right now.
Check the saved settings
- The Targeting tab's sentence names the country.
- A test request with an address in the country fills, and one outside it does not.
- The Delivery tab shows your hours.
Targeting narrows where a line item can win. If a request gets no ad, read the reason before you change the rules.
Troubleshooting
My test request from the Tags tab says No ad came back.
It sends no viewer address, so a line item with a country rule can't match it. Test through the API with an ip.
Changing the rules changed another line item too.
Targeting is kept in an audience. When other line items use it, choose Copy for this line item before editing.
Nothing delivers at some hours.
Check the Schedule and the time zone shown above it.
Video transcript
The narration in full. Download English captions.
0:00 Limit a line item to one country and to set hours.
0:05 You need a line item and a sign-in that can edit campaigns.
0:11 Every name and domain in this video is made up.
0:18 On the line item, open the Targeting tab.
0:23 With no targeting, it serves wherever it buys.
0:29 The rules are kept in an audience made for this line item.
0:34 Choose Add geo rule.
0:38 Set Rule type to Country.
0:42 Enter the country code: US.
0:47 The sentence at the top follows what you enter.
0:52 Choose Save targeting.
0:59 The console's own test request sends no viewer address, so use the API.
1:05 This address counts as the United States in the demo sample table.
1:12 It fills: the line item wins.
1:18 This one counts as the United Kingdom.
1:25 No ad: the reason is audience_not_matched.
1:31 Test requests are not counted or billed.
1:37 Next, hours. Open the Delivery tab.
1:42 Schedule is a grid of the hours in a week.
1:48 Choose Business hours, or click and drag your own.
1:54 The hours follow the line item's time zone, shown above the grid.
2:01 Choose Save. Outside those hours, it does not serve.
2:08 This take is outside them, so Held back by says: Outside its dayparts right now.
2:18 The line item now has a country rule and a schedule.
2:23 If a request gets no ad, read the reason and fix the cause.
2:29 Find why it isn’t serving has its own video.