BingAds / BingAds-PHP-SDK

Other
56 stars 46 forks source link

Undefined class constant 'AbsoluteTopImpressionRatePercent' #160

Closed carpusmedia closed 3 years ago

carpusmedia commented 3 years ago

Hello,

Using SearchQueryPerformanceReportColumn::AbsoluteTopImpressionRatePercent with the SearchQueryPerformanceReportRequest gives the following error:

Uncaught Error: Undefined class constant 'AbsoluteTopImpressionRatePercent'

Code example:

$report = new SearchQueryPerformanceReportRequest();

$report->Format = ReportFormat::Csv;

$report->ReportName = 'Test Report';
$report->ReturnOnlyCompleteData = false; 
$report->Aggregation = ReportAggregation::Daily;

$report->ExcludeColumnHeaders = true;
$report->ExcludeReportFooter = true;
$report->ExcludeReportHeader = true;

$report->Scope = new AccountReportScope();
$report->Scope->AccountIds = array();
$report->Scope->AccountIds[] = 'xxxx';

$report->Time = new ReportTime();
$report->Time->CustomDateRangeStart->Day = '01'; 
$report->Time->CustomDateRangeStart->Month = '01';
$report->Time->CustomDateRangeStart->Year = '2014';

$report->Columns = array (
        SearchQueryPerformanceReportColumn::CampaignId, 
        SearchQueryPerformanceReportColumn::CampaignName,
        SearchQueryPerformanceReportColumn::AdGroupId,
        SearchQueryPerformanceReportColumn::SearchQuery,
        SearchQueryPerformanceReportColumn::Impressions,
        SearchQueryPerformanceReportColumn::Clicks,
        SearchQueryPerformanceReportColumn::Spend,
        SearchQueryPerformanceReportColumn::AbsoluteTopImpressionRatePercent,
 );

Why is this?

Regards, Chris

carpusmedia commented 3 years ago

I'm using an older version of the BingAds-PHP-SDK, I can see the current one supports all columns listed on https://docs.microsoft.com/en-us/advertising/reporting-service/searchqueryperformancereportcolumn