How to use targeting to device platform from Dot NET API?

144 views
Skip to first unread message

Dmitry Gavrilov

unread,
Feb 27, 2017, 12:33:44 PM2/27/17
to AdWords API Forum
Hello there! 
Sorry for my bad english.

How to use targeting to device platform from Dot NET API? 

I was set the checkbox Mobile and unchecked the checkboxes Computers and Tablet on the adwords web site page Campaign Settings >> Advanced settings >> Devices.  
Then I executed my code 

CampaignCriterionService campaignCriterionService = (CampaignCriterionService)_user.GetService(AdWordsService.v201609.CampaignCriterionService);
Selector criterionPageSelector = new Selector { fields = "BaseCampaignId,BidModifier,CampaignId,IsNegative,CampaignCriterionStatus".Split(',')
, paging = new Paging(), predicates = new[] {
new Predicate()
{
field = "CampaignId",
@operator = PredicateOperator.EQUALS,
values = new[] { campNetId }
} } };


CampaignCriterionPage campaignCriterionPage = new CampaignCriterionPage();
criterionPageSelector.paging.startIndex = offset;
criterionPageSelector.paging.numberResults = pageSize;
campaignCriterionPage = campaignCriterionService.get(criterionPageSelector);

var campPlatformCriterions = campaignCriterionPage.entries.Where(it => it.criterion is Platform).ToList();

Well and what I saw in campPlatformCriterions that there are all the platforms in the criterions: mobile, and tablet, and desctop.
I tried to remove platform criterions and the BatchJobOperation was ended success, unfortunatelly on the web site nothing changed. 

Tell me please, how I can get real platform targetings and how I can change it?





Shwetha Vastrad (AdWords API Team)

unread,
Feb 27, 2017, 3:01:44 PM2/27/17
to AdWords API Forum
Hi,

When you opt out of a particular platform, these criteria will still be returned in the response and the bid modifier will be 0.0. To target a particular platform, you need to add a Platform criteria using CampaignCriterionService. To opt out of a particular platform using the API, you need to set the bid modifier to 0.0. You can only target and change bid modifiers for Platform criterion at the campaign level. Please see the SetBidModifier example which shows how to set a bid modifier for the mobile platform for a given campaign.

Regards,
Shwetha, AdWords API Team.

Dmitry Gavrilov

unread,
Mar 4, 2017, 11:09:07 AM3/4/17
to AdWords API Forum
Hello Shwetha! 
Thanx for you reply!

Do you mean that I can use Platform only to change bid modifier and can not change the platform targeting?



Dmitry Gavrilov with best regards
  

понедельник, 27 февраля 2017 г., 23:01:44 UTC+3 пользователь Shwetha Vastrad (AdWords API Team) написал:

Shwetha Vastrad (AdWords API Team)

unread,
Mar 6, 2017, 10:53:42 AM3/6/17
to AdWords API Forum
Hi Dmitry,

As specified in this guide, only positive targeting and bid modification is allowed for Platform criteria. To opt out of a particular platform, you need to set its bid modifier to 0.0. Please see the criteria usage guide for the targeting and bidding options available for different criteria types. 

Dmitry Gavrilov

unread,
Mar 9, 2017, 11:18:04 AM3/9/17
to AdWords API Forum
Hi Shwetha!

Now I can changing targeting by platform, thanks for your help!

But I'm not understand still one thing about this:
How I can take through API an information about platform targeting checkboxes values wich I set in the web page? 
The API allways return all the platforms regardless they real state on the web page.  

Dmitriy Gavrilov with best regards.


Shwetha Vastrad (AdWords API Team)

unread,
Mar 9, 2017, 2:41:20 PM3/9/17
to AdWords API Forum
Hi Dmitry,

Yes, the API response will contain all three platform criteria. A bidModifier of 0.0 is equivalent to the targeting checkbox being unchecked for a device in the web interface. 

Dmitry Gavrilov

unread,
Mar 24, 2017, 1:32:54 PM3/24/17
to AdWords API Forum
Thanks you a lot!

четверг, 9 марта 2017 г., 22:41:20 UTC+3 пользователь Shwetha Vastrad (AdWords API Team) написал:
Reply all
Reply to author
Forward
0 new messages