
![]() |
Google Ads API Team |
Currently using the latest API version for PHP (V15). We are trying to specify a campaign’s ‘Devices’ setting, adding it as a ‘Campaign Criterion’ (ref. https://developers.google.com/google-ads/api/reference/rpc/v15/CampaignCriterion).The operation is inside a list of operations as it follows:
// Adapted from extract code for testing values based on class Device
// Google\Ads\GoogleAds\V15\Enums\DeviceEnum\Device.php
$operations = [];
$devices = ['MOBILE', 'TABLET'];
foreach ($devices as $device) {
$operations[] = new MutateOperation([
'campaign_criterion_operation' => new CampaignCriterionOperation([
'create' => new CampaignCriterion([
'campaign' => ResourceNames::forCampaign($customer_id, $campaign_temp_id),
'type' => CriterionType::DEVICE,
'negative' => false,
'status' => CampaignCriterionStatus::value('ENABLED'),
//'bid_modifier' => 0.5,
'device' => new DeviceInfo([
'type' => Device::value($device)
])
])
])
]);
}
$service_client = $ads_client->getGoogleAdsServiceClient();
$response = $service_client->mutate($customer_id, $operations);
The actions for those ‘Devices’ operations run normally, without showing any error, it even returns a resource name. The thing here is that, the change doesn’t seems to be shown as expected on the Google UI.
Current behavior


The available options are set based on ‘DeviceEnum\Device.php’ (ref. https://github.com/googleads/google-ads-php/blob/main/src/Google/Ads/GoogleAds/V15/Enums/DeviceEnum/Device.php).
Hi,
Thank you for getting back to us.
Upon checking the provided code, I found that you are using the 'type' field in the request. Kindly note that property ‘type’ is an output-only property. Do not use it in the request.
Please try to include valid input properties in the request. I would recommend you check campaignCriteria to know the valid and invalid input fields in the request with respect to campaign criteria.
If you are still getting the same issue, even after following the above documentation,please get back to us with complete API logs (request and response with request-id and request header) generated at your end.
Kindly note that you have to enable logging if you are using a client library. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.