Google ADS API PHP SDK从广告系列排除中删除IP
我正在尝试通过API从广告系列中删除IP地址。我可以使用iPblockInfo和竞选活动配置来添加它们,但我似乎无法将其删除。
该操作的构建看起来像:
$campaignCriterion = new CampaignCriterion( [
'ip_block' => new IpBlockInfo( [
'ip_address' => $item[ 'ip' ]
] ),
'negative' => true, // setting it to negative
'campaign' => ResourceNames::forCampaign( $customerId, $item[ 'campaignId' ] )
] );
要删除它正在使用的:
$campaignCriterionOperation->setRemove( $campaignCriterion );
然后通过mutateCampaignCriteria发送。
当我使用集合删除时,我将获取一个对象到字符串错误。因此,我查看了SDK,发现是的SetRemove Want是资源输出,因为我猜测它是要删除操作实际上并未删除指定的IP或标准。当Google上的文档对此并不是很有描述性,是否有人会在哪里看何处或如何删除IP的指导。
在ipblockinfo内部也有一个清晰的IP地址,但这纯粹是为了在发送操作之前在对象中的变量中删除。
I'm trying to remove IP addresses from a campaign via the API. I'm able to add them fine using ipblockinfo and campaignCriterionOperation but I can't seem to remove it.
The build for the operation looks like :
$campaignCriterion = new CampaignCriterion( [
'ip_block' => new IpBlockInfo( [
'ip_address' => $item[ 'ip' ]
] ),
'negative' => true, // setting it to negative
'campaign' => ResourceNames::forCampaign( $customerId, $item[ 'campaignId' ] )
] );
and to remove it I'm using :
$campaignCriterionOperation->setRemove( $campaignCriterion );
Which is then sent via a mutateCampaignCriteria.
When I use the set remove I get a object to string error. So I looked into the SDK and saw that yes setRemove want's a resource output only as I'm guessing it's about removing the operation not actually removing the ip or criterion specified. Does anyone have any guidance on where to look or how to do a removal of an ip as Googles docs on this aren't very descriptive.
Inside the IPBlockInfo there is also a Clear IP address but this is purely to unset the variable in the object before sending the operation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论