Hello
Thank you Luis.

I tried coding as shown below using Platform, but an error will be returned.

error contents:
OperatorError.OPERATOR_NOT_SUPPORTED @ operations [1] .operand.criterion; 
trigger: 'CriterionId {id = 30000}', OperatorError.OPERATOR_NOT_SUPPORTED @ 
operations [2] .operand.criterion; trigger: 'CriterionId {id = 30001}


Coding content:
    $ platform = new Platform ();
    $ platform-> setId (30000);
    // $ platform-> setPlatformName ('Desktop');
    $ campaignCriteria [] = new CampaignCriterion ($ campaignId, null, $ 
platform);

    // HighEndMobile
    $ platform = new Platform ();
    $ platform-> setId (30001);
    // $ platform-> setPlatformName ('HighEndMobile');
    $ campaignCriteria [] = new CampaignCriterion ($ campaignId, null, $ 
platform);

    // Tablet
    $ platform = new Platform ();
    $ platform-> setId (30002);
    // $ platform-> setPlatformName ('Tablet');
    $ campaignCriteria [] = new CampaignCriterion ($ campaignId, null, $ 
platform);

    $ operations = [];
    foreach ($ campaignCriteria as $ campaignCriterion) {
      $ operation = new CampaignCriterionOperation ();
      $ operation-> setOperator (Operator :: ADD);
      $ operation-> setOperand ($ campaignCriterion);
      $ operations [] = $ operation;
    }

    $ result = $ campaignCriterionService-> mutate ($ operations);

Thank you

2018年7月12日木曜日 14時27分52秒 UTC+9 Luis Xander Talag (AdWords API Team):
>
> Hi,
>
> Are you referring to targeting the mobile and tablet device to your 
> campaign? If so, you may use the CampaignCriterionService 
> <https://developers.google.com/adwords/api/docs/reference/v201806/CampaignCriterionService>
>  and 
> use the Platform 
> <https://developers.google.com/adwords/api/docs/reference/v201806/CampaignCriterionService.Platform>
>  criterion 
> to target the mobile and tablet device. You may refer to this guide 
> <https://developers.google.com/adwords/api/docs/appendix/codes-formats#platforms>
>  for 
> their respective criterion id. Also, you may refer to this sample code 
> <https://developers.google.com/adwords/api/docs/samples/php/targeting#add-targeting-criteria-to-a-campaign>
>  in 
> PHP on how to add a criteria to your campaign. However, that sample code 
> used Location and Language criteria.  All you need to do is to change the 
> criterion object to Platform.
>
> Feel free to write back for any clarifications.
>
> Thanks and regards,
> Luis
> AdWords API Team
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/08294b8c-a459-412d-b1ea-5a0ba5c6b40d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... mYama
    • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... mYama
        • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to