AdWords allows you to target your ad groups to people of specific ages and genders on Google’s Display Network. Version v201209 of the AdWords API adds support for this feature.
To enable demographic targeting in an AdGroup , add a Gender or AgeRange criterion using the AdGroupCriterionService . You can target a criterion by adding a BiddableAdGroupCriterion , and exclude one using NegativeAdGroupCriterion . You can use the bid property of BiddableAdGroupCriterion to set a bid for a specific gender or age range. The following C# code snippet shows the concept in action, where we target male users with a specific CPC of two dollars and exclude users of age range between 18 and 24 years old.
// Create biddable ad group criterion for gender, male. See
// https://developers.google.com/adwords/api/docs/appendix/genders for
// criteria ID.
Gender genderTarget = new Gender();
genderTarget.id = 10;
BiddableAdGroupCriterion genderBiddableAgc = new BiddableAdGroupCriterion();
genderBiddableAgc.adGroupId = adGroupId;
genderBiddableAgc.criterion = genderTarget;
// Set a specific bid for male.
ManualCPCAdGroupCriterionBids bid = new ManualCPCAdGroupCriterionBids();
bid.bidSource = BidSource.CRITERION;
bid.maxCpc = new Bid();
bid.maxCpc.amount = new Money();
bid.maxCpc.amount.microAmount = 2000000;
genderBiddableAgc.bids = bid;
// Create negative ad group criterion for age range 18 to 24. See
// https://developers.google.com/adwords/api/docs/appendix/ages for
// criteria ID.
AgeRange ageRangeNegative = new AgeRange();
ageRangeNegative.id = 503001;
NegativeAdGroupCriterion ageRangeNegativeAgc =
new NegativeAdGroupCriterion();
ageRangeNegativeAgc.adGroupId = adGroupId;
ageRangeNegativeAgc.criterion = ageRangeNegative;
// Create operations.
AdGroupCriterionOperation genderBiddableAgcOp =
new AdGroupCriterionOperation();
genderBiddableAgcOp.operand = genderBiddableAgc;
genderBiddableAgcOp.@operator = Operator.ADD;
AdGroupCriterionOperation ageRangeNegativeAgcOp =
new AdGroupCriterionOperation();
ageRangeNegativeAgcOp.operand = ageRangeNegativeAgc;
ageRangeNegativeAgcOp.@operator = Operator.ADD;
// Add ad group criteria.
AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(
new AdGroupCriterionOperation[] {genderBiddableAgcOp,
ageRangeNegativeAgcOp});
The criteria IDs for gender and age range are available from https://developers.google.com/adwords/api/docs/appendix/genders and https://developers.google.com/adwords/api/docs/appendix/ages respectively.
When targeting by demographics, you can choose to target or exclude people whose age or gender haven’t been identified, by targeting the Undetermined
category. However, keep in mind that Google doesn't infer demographics for all people, and most websites don't provide demographic information for their customers. In addition, some websites on the Display Network opt out of demographic targeting. Excluding the Undetermined
demographic category might prevent a substantial number of people from seeing your ads. So, we recommend that you exclude this category only if your campaign results indicate that you should.
If you have any questions about this new feature or the AdWords API in general, you can ask us on our developer forum , or at the upcoming live office hours with the Developer Relations team. Follow our Google+ page for updates about the AdWords API.
- Anash P. Oommen , AdWords API Team