// Create geographical targeting.
GeoTargeting geoTargeting = new GeoTargeting();
// Include the US, Quebec, Canada, and the B3P Canada postal code.
Location countryLocation = new Location();
countryLocation.setId(2840L);
Location regionLocation = new Location();
regionLocation.setId(20123L);
Location postalCodeLocation = new Location();
postalCodeLocation.setId(9000093L);
geoTargeting.setTargetedLocations(new Location[] {countryLocation, regionLocation,
postalCodeLocation});
// Exclude Chicago and the New York metro area.
Location cityLocation = new Location();
cityLocation.setId(1016367L);
Location metroLocation = new Location();
metroLocation.setId(200501L);
geoTargeting.setExcludedLocations(new Location[] {cityLocation, metroLocation});
// Exclude domains that are not under the network's control.
UserDomainTargeting userDomainTargeting = new UserDomainTargeting();
userDomainTargeting.setDomains(new String[] {"usa.gov"});