To build your dashboard tracking daily spend, impressions, and sales by campaign type using the Amazon Ads API, the key is to understand how Amazon's reporting endpoints are structured.
Here's the right approach:
The Amazon Ads API's reporting endpoints are type-specific. This means you don't pull one big report and then filter by campaign type within it. Instead, you make separate requests to different endpoints for each campaign type you want data for.
Here's how to do it:
Understand Type-Specific Endpoints:
For Sponsored Products (SP) data, you'll use endpoints like /sp/campaigns/report.
For Sponsored Brands (SB) data, you'll use endpoints like /sb/campaigns/report.
For Sponsored Display (SD) data, you'll use endpoints like /sd/campaigns/report.
When you make a request to /sp/campaigns/report, you know all the data in the resulting report is for Sponsored Products campaigns. The campaign type isn't a separate field within that report because the endpoint itself defines it.
Make Separate API Calls for Each Campaign Type: To get data for all your campaign types, you'll need to initiate separate report requests for each one.
Example for Sponsored Products (using v3 reporting, recommended): You'd make a POST request to something like https://advertising-api.amazon.com/reporting/reports with a request body specifying adProduct: "SPONSORED_PRODUCTS" and reportTypeId: "spCampaigns".
Example for Sponsored Brands: You'd make a POST request to the same https://advertising-api.amazon.com/reporting/reports endpoint, but with adProduct: "SPONSORED_BRANDS" and reportTypeId: "sbCampaigns".
And similarly for Sponsored Display.
Process and Combine the Data: Once you've successfully requested, waited for, and downloaded the reports for each campaign type, you'll process them in your dashboard logic.
As you parse each report's data, you'll assign the correct campaign type (e.g., "Sponsored Products," "Sponsored Brands") based on which endpoint the report came from.
You'll extract daily spend (cost), impressions (impressions), and sales (sales7d for SP, or sales for SB/SD, paying attention to attribution windows like 7-day or 14-day).
Then, aggregate or display this data by your assigned campaign type in your dashboard.
Leverage Campaign Metadata (Optional but Useful): If you need additional details about each campaign (like its name, status, or budget type) that aren't directly in the performance reports, you can use the campaign management APIs (e.g., GET /sp/campaigns, GET /sb/campaigns). These APIs return a campaignId and often an adProduct field (or similar) that explicitly states the campaign type. You can then join this metadata with your performance report data using the campaignId.
In summary: The "split by type" happens at the API request level. You ask Amazon for a Sponsored Products report, then a Sponsored Brands report, and so on. Your dashboard then combines these distinct datasets, knowing the type of each based on how you requested it.