Negative Geo Target

135 views
Skip to first unread message

julien levasseur

unread,
Oct 10, 2016, 12:08:59 AM10/10/16
to AdWords API Forum

Hi,

I am trying to exclude a location from a campaign. I am using php lib https://github.com/googleads/googleads-php-lib/tree/master/src/Google/Api/Ads/AdWords/v201607 

I read 
* Ads canonly be negatively geotargeted if a positive geotargeting is also supplied, and
* the negatively geotargeted region must be contained within the positive
* region.

I understood I should use :

$geoTargetTypeSetting->positiveGeoTargetType = 'LOCATION_OF_PRESENCE'; //which should be USA
$geoTargetTypeSetting->negativeGeoTargetType = 'LOCATION_OF_PRESENCE'; // which should be a list of locations

I found the Criteria ID of the locations I want to exclude on https://developers.google.com/adwords/api/docs/appendix/geotargeting.

Here is my code so far, 

$geoTargetTypeSetting = new GeoTargetTypeSetting();
$geoTargetTypeSetting->positiveGeoTargetType = 'LOCATION_OF_PRESENCE';
$geoTargetTypeSetting->negativeGeoTargetType = 'LOCATION_OF_PRESENCE';
$geoTargetTypeSetting->SettingType = ???

$campaign->settings[] = $geoTargetTypeSetting;

How should I specify the Criteria IDs? Maybe SettingType?
What is the Criteria ID for USA as a country?

Thanks,

Joyce Lava

unread,
Oct 10, 2016, 2:00:15 AM10/10/16
to AdWords API Forum
Hi Julien,

GeoTargetTypeSetting is used to determine how to geotarget (e.g.  Location of Presence(LOP), Area of Interest (AOI), or both) and not to geotarget locations (e.g. USA). You would have to use the CampaignCriterionService with Location as the criterion. In the Location object, you can set the ID of the criteria (for USA, the location ID is 2840) based on the targeting table. To exclude geo targets, you should use NegativeCampaignCriterion. The complete details of location targeting is discussed here.

Hope this helps.

Best,
Joyce, AdWords API Team

julien levasseur

unread,
Oct 11, 2016, 5:12:21 PM10/11/16
to AdWords API Forum
Hi Joyce,

$campaignCriteria = array();
$san_francisco = new Location();
$san_francisco->id = 1014221;
$campaignCriteria[] = new CampaignCriterion($campaignId, false, $san_francisco);

The second argument of CampaignCriterion is supposed to make a negative criterion, therefore exclude San Francisco?

Thank you,
Julien

julien levasseur

unread,
Oct 11, 2016, 5:16:45 PM10/11/16
to AdWords API Forum
My mistake, I should use NegativeCampaignCriterion.

Joyce Lava

unread,
Oct 11, 2016, 10:15:31 PM10/11/16
to AdWords API Forum
Hi Julien,

Yes, you should use NegativeCampaignCriterion to exclude geo targets.
Reply all
Reply to author
Forward
0 new messages