Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Campaign Data is not getting proper through SDK #139

Open
siddharth-ethinos opened this issue Sep 25, 2020 · 1 comment
Open

Campaign Data is not getting proper through SDK #139

siddharth-ethinos opened this issue Sep 25, 2020 · 1 comment

Comments

@siddharth-ethinos
Copy link

siddharth-ethinos commented Sep 25, 2020

I tried to get all campaign performance data through below "V13/ReportRequests.php"(GetAudiencePerformanceReportRequest) function but data is not match the live dashboard data.

`function GetAudiencePerformanceReportRequest($accountId)
{
$report = new AudiencePerformanceReportRequest();

$report->Format = ReportFormat::Tsv;
$report->ReportName = 'My Audience Performance Report';
$report->ReturnOnlyCompleteData = false;
$report->Aggregation = ReportAggregation::Daily;

$report->Scope = new AccountThroughAdGroupReportScope();
$report->Scope->AccountIds = array();
$report->Scope->AccountIds[] = $accountId;
$report->Scope->AdGroups = null;
$report->Scope->Campaigns = null;

$report->Time = new ReportTime();
$report->Time->PredefinedTime = ReportTimePeriod::Yesterday;

$report->Columns = array (
        AudiencePerformanceReportColumn::TimePeriod,
        AudiencePerformanceReportColumn::AccountId,
        AudiencePerformanceReportColumn::CampaignId,
        AudiencePerformanceReportColumn::AudienceId,
        AudiencePerformanceReportColumn::Clicks,
        AudiencePerformanceReportColumn::Impressions,
        AudiencePerformanceReportColumn::Ctr,
        AudiencePerformanceReportColumn::AverageCpc,
        AudiencePerformanceReportColumn::Spend,
);

$encodedReport = new SoapVar(
    $report, 
    SOAP_ENC_OBJECT, 
    'AudiencePerformanceReportRequest', 
    $GLOBALS['ReportingProxy']->GetNamespace()
);

return $encodedReport;

}`

Below is the input data before submitting data.

`SoapVar Object
(
[enc_type] => 301
[enc_value] => Microsoft\BingAds\V13\Reporting\AudiencePerformanceReportRequest Object
(
[Aggregation] => Daily
[Columns] => Array
(
[0] => TimePeriod
[1] => AccountId
[2] => CampaignId
[3] => CampaignName
[4] => AudienceId
[5] => Clicks
[6] => Impressions
[7] => Ctr
[8] => AverageCpc
[9] => Spend
)

        [Filter] => 
        [Scope] => Microsoft\BingAds\V13\Reporting\AccountThroughAdGroupReportScope Object
            (
                [AccountIds] => Array
                    (
                        [0] => 151006048
                    )

                [AdGroups] => 
                [Campaigns] => 
            )

        [Time] => Microsoft\BingAds\V13\Reporting\ReportTime Object
            (
                [CustomDateRangeEnd] => 
                [CustomDateRangeStart] => 
                [PredefinedTime] => Yesterday
                [ReportTimeZone] => 
            )

        [ExcludeColumnHeaders] => 
        [ExcludeReportFooter] => 
        [ExcludeReportHeader] => 
        [Format] => Csv
        [ReportName] => My Audience Performance Report
        [ReturnOnlyCompleteData] => 
    )

[enc_stype] => AudiencePerformanceReportRequest
[enc_ns] => https://bingads.microsoft.com/Reporting/v13

)

API data screenshot


SubmitGenerateReport:
Report Request ID: 619312696807

sleep(10 seconds)

PollGenerateReport:
RequestStatus: Success
ReportDownloadUrl: https://bingadsappsstorageprod.blob.core.windows.net:443/hpr-reportdataapi-20-09-25/9a88dbcc-f23b-46bb-9400-a8cb5900e360/My_Audience_Performance_Report.zip?sv=2018-03-28&sr=b&sig=q67yvuXCeBTthFypwCJnL8q%2BTkSjLzlTl9PSIHedPZo%3D&st=2020-09-25T08%3A52%3A07Z&se=2020-09-25T09%3A07%3A07Z&sp=r

Downloading from https://bingadsappsstorageprod.blob.core.windows.net:443/hpr-reportdataapi-20-09-25/9a88dbcc-f23b-46bb-9400-a8cb5900e360/My_Audience_Performance_Report.zip?sv=2018-03-28&sr=b&sig=q67yvuXCeBTthFypwCJnL8q%2BTkSjLzlTl9PSIHedPZo%3D&st=2020-09-25T08%3A52%3A07Z&se=2020-09-25T09%3A07%3A07Z&sp=r.
The report was written to /var/www/html/bing_report/test.zip.
`
In above API screenshot total cost is showing is 1125 but in live dashboard showing 5,535.54. Is anything i am doing wrong.

live_dashboard

@AshishAgMS
Copy link

Hi @siddharth-ethinos,

You should use CampaignPerformanceReportRequest to fetch performance data for all campaigns. AudiencePerformanceReportRequest will return data for campaigns with audience associations and you can see same data in Audience tab in UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants