问题描述
我在使用Bing Ads API从广告组和广告组删除关键字时出现问题:DeleteKeywords服务运营
I am having an issue with deleting a Keyword from and AdGroup using the Bing Ads API: DeleteKeywords Service Operation
这是我的代码PHP:
Here is my code written in PHP:
grv_remove_bing_keyword(2447647796,15644864799);
function grv_remove_bing_keyword( $adgroup_id, $keyword_id ) {
$keyword = new Keyword();
$keyword->Status = 'Delete';
$keyword->Id = $keyword_id;
$request = new DeleteKeywordsRequest();
$request->AdGroupId = $adgroup_id;
$request->KeywordIds = array($keyword);
$result = $GLOBALS['proxy']->GetService()->DeleteKeywords( $request);
}
我做过一些测试:
以下是输出:GetKeywordsByAdGroupId用于验证我在调用时使用了正确的广告组和关键字ID的服务操作: DeleteKeywords服务运营
Below is the output of:GetKeywordsByAdGroupId Service Operation used to verify I was using the correct AdGroup and Keyword Ids in my call to: DeleteKeywords Service Operation
BingAds\CampaignManagement\GetKeywordsByAdGroupIdRequest Object
(
[AdGroupId] => 2447647796
)
The Result:
stdClass Object
(
[Keywords] => stdClass Object
(
[Keyword] => Array
(
[0] => stdClass Object
(
[Bid] => stdClass Object
(
[Amount] => 0.55
)
[DestinationUrl] =>
[EditorialStatus] => Active
[ForwardCompatibilityMap] => stdClass Object
(
)
[Id] => 15644676444
[MatchType] => Broad
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Active
[Text] => Fast Car
)
[1] => stdClass Object
(
[Bid] => stdClass Object
(
[Amount] => 0.55
)
[DestinationUrl] =>
[EditorialStatus] => Active
[ForwardCompatibilityMap] => stdClass Object
(
)
[Id] => 15644864423
[MatchType] => Broad
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Paused
[Text] => Faster Car
)
[2] => stdClass Object
(
[Bid] => stdClass Object
(
[Amount] => 0.55
)
[DestinationUrl] =>
[EditorialStatus] => Active
[ForwardCompatibilityMap] => stdClass Object
(
)
[Id] => 15644864799
[MatchType] => Broad
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Paused
[Text] => Faster mo betta Car
)
)
)
)
请求: 尝试删除广告组中的关键字:2447647796与KwId:15644864799
The Request: Trying to delete the keyword within AdGroup:2447647796 with KwId:15644864799
BingAds\CampaignManagement\DeleteKeywordsRequest Object
(
[AdGroupId] => 2447647796
[KeywordIds] => Array
(
[0] => BingAds\CampaignManagement\Keyword Object
(
[Bid] =>
[DestinationUrl] =>
[EditorialStatus] =>
[ForwardCompatibilityMap] =>
[Id] => 15644864799
[MatchType] =>
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Delete
[Text] =>
)
)
)
The Result:
stdClass Object
(
[PartialErrors] => stdClass Object
(
[BatchError] => Array
(
[0] => stdClass Object
(
[Code] => 1528
[Details] =>
[ErrorCode] => CampaignServiceKeywordDoesNotBelongToAdGroupId
[Index] => 0
[Message] => Keyword specified does not belong to the AdGroup.
[Type] => BatchError
)
)
)
)
推荐答案
谢谢,
Matt
这篇关于PHP DeleteKeywordsRequest || [代码] => 1528 [ErrorCode] => CampaignServiceKeywordDoesNotBelongToAdGroupId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!