Hi Ben,

Thank you for reaching out. To further investigate this, could you provide
the complete JSON request and response logs when you encountered the error?
If you haven't enabled logging yet, you could refer to the README
<https://developers.google.com/adwords/api/docs/clientlibraries> section of
your client library for detailed instructions on how to enable it. Please
use the *reply privately to author* option.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/15/19 21:29:50 [email protected] wrote:

Hello,

I am trying to target a campaign on a particular device in a similar way
targeting is done in this example:
https://developers.google.com/google-ads/api/docs/samples/add-campaign-targeting-criteria

I am able to target a campaign on a location using a similar approach to
what is done in this example and in the code below.

However, I am getting the following error when trying to target a device:

errors {

 error_code {

   operator_error: OPERATOR_NOT_SUPPORTED

 }

 message: "Operator not supported."

 trigger {

   string_value: "CriterionId{id=30000}"

 }

 location {

   field_path_elements {

     field_name: "operations"

     index {

     }

   }

   field_path_elements {

     field_name: "create"

   }

   field_path_elements {

     field_name: "device"

   }

 }

}


Here is the api client library usage that is causing this error:

public String targetCampaignDevice(Long customerId, Long campaignId,
DeviceEnum.Device device)
{
    GoogleAdsClient googleAdsClient = getGoogleAdsClient();

    String campaignResourceName = ResourceNames.campaign(customerId,
campaignId);
    ArrayList<CampaignCriterionOperation> ops = new ArrayList<>();

    // Set device criteria
    CampaignCriterion.Builder criterionBuilder =
        CampaignCriterion.newBuilder()

.setCampaign(StringValue.newBuilder().setValue(campaignResourceName).build())
            .setDevice(DeviceInfo.newBuilder().setType(device).build());

    CampaignCriterion criterion = criterionBuilder.build();

    ops.add(CampaignCriterionOperation.newBuilder()
                .setCreate(criterion)
                .build());

    try (CampaignCriterionServiceClient campaignCriterionServiceClient =

googleAdsClient.getLatestVersion().createCampaignCriterionServiceClient()) {
        MutateCampaignCriteriaResponse response =
            campaignCriterionServiceClient.mutateCampaignCriteria(
                Long.toString(customerId), ops);
    }
    return campaignResourceName;
}


Device.Enum is imported from *com.google.ads.googleads.v1.enums.DeviceEnum*.


Any suggestions for this issue? Could someone provide an example of this
being done correctly?

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/479749f2-a116-4e8f-ae60-802ec64df624%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/479749f2-a116-4e8f-ae60-802ec64df624%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/18vg1l00000000008kj1lq0007rgr0x6kmj8d9m70o30c1g68r34c9i%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • Targeti... Ben Johnson
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... Vinutha Nayak
    • RE... Google Ads API Forum Advisor Prod

Reply via email to