【问题标题】:PHP SOAP Request to Bing Ads API对 Bing 广告 API 的 PHP SOAP 请求
【发布时间】:2020-03-10 03:38:07
【问题描述】:

我很难弄清楚如何正确地将排序的 SOAP 请求编码到 Bing Ads API。不喜欢使用他们的 SDK,我过去使用过。

“Scope”、“Time”、“Filter”和“Sort”参数不影响结果。而是返回整个帐户关键字。对于“范围”,我使用 Adgroups 参数来选择该 Adgroup 中的关键字。非常感谢任何帮助。

参考:https://docs.microsoft.com/en-us/advertising/reporting-service/keywordperformancereportrequest?view=bingads-13

WSDL:https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/V13/ReportingService.svc?singleWsdl

        $request = [
        'ReportRequest' => new SoapVar(
        [
            'Format' => 'Csv',
            'ReportName' => 'Bing Keyword Performance Report',
            'ReturnOnlyCompleteData' => false,
            'Aggregation' => 'Daily',
            'Sort' => array('SortColumn' => 'Clicks','SortOrder' => 'Ascending'),
            'Scope' =>  ['AdGroups'  => array(array('AccountId' => $bClientId,
            'AdGroupId' => $apiDBIdGroupBing,
            'CampaignId' => $apiDBIdCampaignBing,
            ))],
            'Time' => [
                'CustomDateRangeStart' => 
                array('Day' => $startDay,'Month' => $startMonth,'Year' => $startYear),
                'CustomDateRangeEnd' => 
                array('Day' => $endDay,'Month' => $endMonth,'Year' => $endYear)
                ],
            'Filter' => ['Keywords' => array($criteriaValue)],
            'Columns' => [
                  "TimePeriod",
                  "Spend",
                  "Clicks",
                  "CurrentMaxCpc",
                  "Impressions",
                  "AdGroupName"
            ]
        ],
        SOAP_ENC_OBJECT,
        'KeywordPerformanceReportRequest',
         "https://bingads.microsoft.com/Reporting/v13"
    )];

【问题讨论】:

    标签: php soap bing-api


    【解决方案1】:

    已解决:

                $request = [
            'ReportRequest' => new SoapVar(
            [
                'Format' => 'Csv',
                'ReportName' => 'Bing Keyword Performance Report',
                'ReturnOnlyCompleteData' => false,
                'Aggregation' => 'Monthly',
                'Sort' => array('SortColumn' => 'Clicks','SortOrder' => 'Ascending'),
                'Scope' => ['AccountIds' => [$bClientId]],
                'MaxRows' => '9000000',
                'Time' => ['PredefinedTime' => $reportTimeFrame],
                'Columns' => [
                    "Keyword",
                    "Spend",
                    "CampaignId",
                    "AdGroupId",
                    "AveragePosition",
                    "CurrentMaxCpc",
                    "KeywordId",
                    "BidMatchType",
                    "Impressions",
                    "Clicks",
                    "TimePeriod",
                    "QualityScore",
                    "ExpectedCtr",
                    "AdRelevance",
                    "LandingPageExperience",
                    "CampaignStatus",
                    "AdGroupStatus",
                    "KeywordStatus",
                    "AccountName",
                    "CampaignName",
                    "AdGroupName",
                    "BidStrategyType",
                ]
            ],
            SOAP_ENC_OBJECT,
            'KeywordPerformanceReportRequest',
             "https://bingads.microsoft.com/Reporting/v13"
            )];
    
            $response = $SoapClient->SubmitGenerateReport($request);
    

    【讨论】:

      猜你喜欢
      • 2012-11-09
      • 1970-01-01
      • 1970-01-01
      • 2021-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多