Hi Mike, Nice to know you resolved your issue. For future reference, the field you need to set (and currently doing using the constructor parameters) is GeoTarget::excluded. See http://code.google.com/apis/adwords/docs/reference/v201008/CampaignTargetService.GeoTarget.html#excluded for details.
Cheers, Anash P. Oommen, AdWords API Advisor. On Mar 8, 12:05 am, uby308 <[email protected]> wrote: > Well if anyone is interested I managed to find the solution to this. > > // Create geo targets. > $geoTargetList = new GeoTargetList(); > $geoTargetList->campaignId = $campaignId; > $geoTargetList->targets = array(new CountryTarget('GB'), new > ProvinceTarget('GB-NIR',true));// Include United Kingdom, Exclude > Northern Ireland. > > The second argument of ProvinceTarget should be set to true if you > want to exclude that area. NOTE the country level area must be > included before you can exclude the province so > > array(new CountryTarget('GB'), new ProvinceTarget('US-NY',true)); > > would not work, you would need to include the US first (new > CountryTarget('US')) then exclude New York as above. > > A full list of country / province codes can be found here > > http://code.google.com/apis/adwords/docs/appendix/geotargeting.html > > Mike > > On Mar 7, 2:39 pm, uby308 <[email protected]> wrote: > > > > > > > > > I am an API newbie. I am trying to create a campaign with various > > geotargetting options. > > > In the PHP example library the code to create geo targetting is this > > > // Create geo targets. > > $geoTargetList = new GeoTargetList(); > > $geoTargetList->campaignId = $campaignId; > > $geoTargetList->targets = > > array(new CountryTarget('US'), new CountryTarget('JP')); > > > This works no problem, however in the Adwords web interface there is an > > option to target away from various neighbourhoods maybe something like > > array(new RegionTargetAwayFrom('NY')) etc > > > I can't find anything in the documentation - does it exist in the API? If > > not would the answer be to copy them from an existing campaign I set up > > manually? > > > Thanks > > > Mike -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en
