Hi.
We Use PHP and I was following examples:
https://developers.google.com/adwords/api/docs/guides/extension-settings#update_ad_extensions
and everything works fine if i run code in browser like
http://mysite.com/myfile.php so code is inside "myfile.php" file
But if I run using cron, I get:
exception 'Google\AdsApi\AdWords\v201710\cm\ApiException' with message
'[EntityNotFound.INVALID_ID @ operations[0].operand.campaignId;
trigger:'CampaignId: 94408149']' in
/PATH/TO/LIBRARY/lib/Google/src/Google/AdsApi/Common/Util/Reflection.php:39
SOAP:
AW_SOAP.WARNING: clientCustomerId=MY-ID operations=3
service=CampaignExtensionSettingService method=mutate responseTime=160
requestId=00055f3907c35e200a3f3b12820373fb server=adwords.google.com
isFault=1 faultMessage=[EntityNotFound.INVALID_ID @
operations[0].operand.campaignId; trigger:'CampaignId: 94408149']
part of code we use:
$campaignId = "944081497";
$campaignExtensionSettingService = $adWordsServices->get($session,
CampaignExtensionSettingService::class);
$selector = new Selector();
$selector->setFields(['CampaignId', 'ExtensionType', 'Extensions']);
$selector->setPredicates([
new Predicate('CampaignId', PredicateOperator::EQUALS,
[$campaignId]),
new Predicate('ExtensionType', PredicateOperator::EQUALS,
[FeedType::PRICE])
]);
$page = $campaignExtensionSettingService->get($selector);
$campaignExtensionSetting = $page->getEntries()[0];
$campaignExtensionSetting->setExtensionType(FeedType::PRICE);
If I debug $campaignExtensionSetting->getCampaignId(); - I get corrupted
value ”@ I (get 944081497 if run in http://mysite.com/myfile.php)
Again if I run http://mysite.com/myfile.php I get 944081497 which is right.
So in error above you see "94408149" which is missing 7 in the end and
that's why doesn't work.
I've tried intval() to floatval() as suggested here
https://groups.google.com/forum/#!topic/adwords-api/NEjJg_7GXQw but it
doesn't help..
What can be a reason that Google returns corrupted ID?
I noticed that other data is corrupted:
Google\AdsApi\AdWords\v201710\cm\CampaignExtensionSetting::__set_state(array(
'campaignId' => '”@ I',
'extensionType' => 'PRICE',
....
Google\AdsApi\AdWords\v201710\cm\Money::__set_state(array(
'microAmount' => ' 4p' . "\0" . '',
'feedId' => '9 …U',
'feedItemId' => ' V…xf',
'policyData' =>
array (
0 =>
Google\AdsApi\AdWords\v201710\cm\FeedItemPolicyData::__set_state(array(
'placeholderType' => 35,
'feedMappingId' => 'B s',
......
so microAmount, feedId, feedItemId, feedMappingId are wrong too
running http://mysite.com/myfile.php - all is good
please assist
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords 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 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/332bfe6a-c7b8-44e9-8be6-13620007a4ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.