Hello, I am trying to create a mobile and tablet bid modifier at campaign level, using the new Ads API Beta. I used the example "AddAdGroupBidModifier.php" from the examples library and tried to modify it to do the same function at campaign level, but I receive an error message.
Does anyone know how to solve this? Or is there any further documentation
or an example to see how to build the request?
Many thanks in advance,
Christoph
*This is part of my code where I define the request: (Full code in the
attachment)*
$CampaignBidModifier = new CampaignBidModifier([
'campaign' => new StringValue(
['value' => ResourceNames::forCampaign($customerId,
$CampaignId)]
),
'bid_modifier' => new DoubleValue(['value' =>
$bidModifierValue]),
'device' => new DeviceInfo(['type' => Device::MOBILE])
]);
*This is the error that I get:*
*Fatal error*: Uncaught UnexpectedValueException: Invalid message property:
device in
/www/htdocs/w01745db/api.thegoodtraffic.com/google-ads-php-master/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php:992
Stack trace: #0
/www/htdocs/w01745db/api.thegoodtraffic.com/google-ads-php-master/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(79):
Google\Protobuf\Internal\Message->mergeFromArray(Array) #1
/www/htdocs/w01745db/api.thegoodtraffic.com/google-ads-php-master/src/Google/Ads/GoogleAds/V0/Resources/CampaignBidModifier.php(70):
Google\Protobuf\Internal\Message->__construct(Array) #2
/www/htdocs/w01745db/api.thegoodtraffic.com/google-ads-php-master/api/management/AddCampaignBidModifier.php(122):
Google\Ads\GoogleAds\V0\Resources\CampaignBidModifier->__construct(Array)
#3
/www/htdocs/w01745db/api.thegoodtraffic.com/google-ads-php-master/api/management/AddCampaignBidModifier.php(74):
Google\Ads\GoogleAds\Management\AddCampaignBidModifier::runExample(Object(Google\Ads\GoogleAds\Lib\GoogleAdsClient),
in
*/www/htdocs/w01745db/api.thegoodtraffic.com/google-ads-php-master/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php*
on line *992*
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/abb48e4b-49ef-49d0-9be5-5142f80583ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<<attachment: AddCampaignBidModifier.php>>
