Google Adwords API total cost spent per day ExpressJS

447 views
Skip to first unread message

Aroup Goldar Dhruba

unread,
Dec 5, 2016, 12:29:58 PM12/5/16
to AdWords API Forum
I want to find the total spent value on Google Adwords API on each day for an e-commerce website in an ExpressJS application.Searching on the internet there were no such results for ExpressJS Framework. All the codes were on other languages. So far I have the idea that , the cost should be in the CAMPAIGN_PERFORMANCE_REPORT. What fields should I check if I have to calculate the cost for Ads for that day ?

I have decided to use one of the two modules :



Can anyone help me to show the process of finding the total cost spent on a day for Google Adwords through one of these modules? 

Thanks in Advance !

Shwetha Vastrad (AdWords API Team)

unread,
Dec 5, 2016, 4:06:22 PM12/5/16
to AdWords API Forum
Hi,

Since these frameworks are not ones that are supported by our team, I'm afraid I wouldn't be able to comment on their usage. I can however help you in determining the correct report to be used. The Campaign Performance Report includes all statistics aggregated by default at the campaign level, one row per campaign and the Ad Performance Report includes all statistics aggregated at the ad level, one row per ad. Depending on the level at which you want to aggregate your results, you can choose different reports. The Cost field is available in the report types listed here.

You can specify different date ranges to get data within that duration. You can also segment your report data by date to get the breakdown of metrics for each day. 

Regards,
Shwetha, AdWords API Team.

Aroup Goldar Dhruba

unread,
Dec 6, 2016, 6:03:26 AM12/6/16
to AdWords API Forum

Thanks for your kind reply. Could you please give me two dummy reports (One of Ad performance and One of Campaign performance Report) so that I can visualize this matter properly and for applying proper logic in my application .

Thanks in Advance ! 

Shwetha Vastrad (AdWords API Team)

unread,
Dec 6, 2016, 1:13:03 PM12/6/16
to AdWords API Forum
Hi,

A sample Campaign Performance Report is provided here. I'm afraid I don't have dummy reports which could be helpful in visualizing the data. You can use the following cURL command to download reports from your account without using any of the client libraries. 

curl -X POST -H "developerToken: YOUR_DEVELOPER_TOKEN" -H "clientCustomerId: YOUR_clientCustomerId" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -d '__rdquery=SELECT CampaignId, AdGroupId, Impressions, Clicks, Cost FROM AD_PERFORMANCE_REPORT DURING LAST_7_DAYS&__fmt=CSV' "https://adwords.google.com/api/adwords/reportdownload/v201609"

This will be more helpful in getting sample reports. You need to provide the AWQL report query in the "__rdquery" parameter and the report download format in the "__fmt" parameter. If you are working with test accounts, be sure to request zero impression rows by setting the includeZeroImpressions header to true.
Reply all
Reply to author
Forward
0 new messages