Hi,
i'm trying to change de Name for a AdGroupAd ImageAd , I get all the
object, set the name and print it using getName, till here everythings is
ok.
Then I prepare the operations to mutate it:
$operation = new AdOperation();
$operation->setOperand($adGroupAd->getAd());
$operation->setOperator(Operator::SET);
$operations[] = $operation;
When I call to mutate method
$adGroupAd = $adService->mutate($operations)->getValue()[0];
This is the response:
*operations=1 service=AdService method=mutate responseTime=194
requestId=0005a2c95037f23a0a3780025f0d90a2 server=adwords.google.com
isFault=1 faultMessage=[AdError.INVALID_AD_TYPE @ operations[0].operand.id]*
How is possible if I am getting the AdGroupAd and just setting a new name?
All the code Attached:
var_dump($adGroupAd->getAd()->getName()); // ok
$adGroupAd->getAd()->setName($adGroupAd->getAd()->getName() . '.TEST'); // ok
var_dump($adGroupAd->getAd()->getName()); // ok
$operation = new AdOperation();
$operation->setOperand($adGroupAd->getAd());
$operation->setOperator(Operator::SET);
$operations[] = $operation;
var_dump($operations); // ok
$adGroupAd = $adService->mutate($operations)->getValue()[0]; // NOK...
printf(
"Ad of type '%s' with ID %d has updated name '%s'.\n",
$adGroupAd->getAd()->getType(),
$adGroupAd->getAd()->getId(),
$adGroupAd->getAd()->getName()
);
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/5dc9943f-b419-45c6-847d-f494b9b13ac6%40googlegroups.com.