How to get daily cost report in one call with Adwords Api

2.3k Views Asked by At

I am developing a web app usign with Adwords Api. But I am in trouble with getting daily report only one call.

I am using AWQL;

If I run this query:

SELECT CampaignName, Clicks, Impressions, Cost FROM CAMPAIGN_PERFORMANCE_REPORT DURING 20170301,20170308

I am getting this response:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<report>
    <report-name name="CAMPAIGN_PERFORMANCE_REPORT"/>
    <date-range date="Mar 1, 2017-Mar 8, 2017"/>
    <table>
        <columns>
            <column name="campaign" display="Campaign"/>
            <column name="clicks" display="Clicks"/>
            <column name="impressions" display="Impressions"/>
            <column name="cost" display="Cost"/>
        </columns>
        <row campaign="test Kampanya: 1" clicks="0" impressions="0" cost="0"/>
    </table>
</report>

But I want to get report daily sperated. So If I run another query with add "DATE" parameter.

SELECT CampaignName, Clicks, Impressions, Cost, DATE FROM CAMPAIGN_PERFORMANCE_REPORT DURING 20170301,20170308

Adwords api take to me following response.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<report>
    <report-name name="CAMPAIGN_PERFORMANCE_REPORT"/>
    <date-range date="Mar 1, 2017-Mar 8, 2017"/>
    <table>
        <columns>
            <column name="campaign" display="Campaign"/>
            <column name="clicks" display="Clicks"/>
            <column name="impressions" display="Impressions"/>
            <column name="cost" display="Cost"/>
            <column name="day" display="Day"/>
        </columns>
    </table>
</report>

Please help!

How can I get CAMPAIGN_PERFORMANCE_REPORT and ACCOUNT_PERFORMANCE_REPORT daily?

1

There are 1 best solutions below

1
On BEST ANSWER

Your second example is the correct call to get all campaigns' metrics segmented on a daily basis. However take note that the field is called Date and not DATE.

As to why you don't see anything in the response, this is because none of the resulting rows of your query have an impression count that is non-zero. By default, these rows are not being returned. You can use the includeZeroImpressions HTTP header if you want to also have those data returned.

About the ACCOUNT_PERFORMANCE_REPORT, I'm not sure what additional information you'd like to retrieve. If your looking for daily spend over the whole account, just add the Date field to your report defintion exactly as you did for the CAMPAIGN_PERFORMANCE_REPORT.