Ad Set Detail Metrics API
This section provides detailed information about the Ad Set Detail Metrics API in Retail Media Reporting.
Overview
The Ad Set Detail Metrics API retrieves detailed metrics for ad sets including placement and product-level data. This API returns all-time data (no date filtering) and provides insights into the performance of individual ad sets within your campaigns, helping you track and analyze the effectiveness of your advertising sets across various placements and products.
Authentication
This API uses OAuth 2.0 client credentials flow for authentication. See the Authentication section for detailed instructions.
API Endpoint
Method: GET
URL: {BASE_URL}/retail-media/supplier/{supplierId}/retailers/{retailerId}/campaign/{campaignId}/adset-details-metrics
Path Parameters
Parameter | Type | Description |
---|---|---|
supplierId | string | The supplier identifier |
retailerId | string | The retailer identifier |
campaignId | string | The campaign identifier |
Request Headers
Authorization: Bearer {access_token}
Content-Type: application/json
Response
Success Response
Status Code: 200 OK
{
"status": "success",
"message": "Ad set detail metrics retrieved successfully",
"errorCode": "",
"data": {
"adSets": [
{
"name": "Ad Set 1",
"version": "v1",
"placements": [
{
"name": "Homepage Banner",
"products": [
{
"name": "Product A",
"link": "https://example.com/product-a",
"impressions": "15000",
"roas": "2.5",
"clicks": "450",
"amountSpent": "2500.00",
"discount": "125.00",
"avgCPC": "5.56",
"avgCPA": "25.00",
"avgCPM": "166.67",
"sponsoredUnitsSold": "25",
"attributedRevenue": "6250.00",
"reach": "12000",
"frequency": "1.25",
"bannerId": "banner_123"
}
]
}
]
}
]
},
"metadata": {}
}
Available Metrics
The Ad Set Detail Metrics API provides comprehensive data about your ad sets, including performance indicators and financial metrics. Here's a detailed breakdown of the available metrics:
Metric | Description | Type | Aggregation |
---|---|---|---|
name | Name of the ad set | string | All-Time |
version | Version of the ad set | string | All-Time |
placements | Array of placements within the ad set | array | All-Time |
products | Array of products within each placement | array | All-Time |
impressions | Number of times the product was displayed | string | All-Time |
roas | Return on ad spend (ROAS) for the product | string | All-Time |
clicks | Number of clicks received | string | All-Time |
amountSpent | Total amount spent on the product | string | All-Time |
discount | Discount amount applied to the product | string | All-Time |
avgCPC | Average cost per click | string | All-Time |
avgCPA | Average cost per acquisition | string | All-Time |
avgCPM | Average cost per thousand impressions | string | All-Time |
sponsoredUnitsSold | Number of units sold through sponsored ads | string | All-Time |
attributedRevenue | Revenue attributed to the sponsored product | string | All-Time |
reach | Banner reach metric | string | All-Time |
frequency | Banner frequency metric | string | All-Time |
bannerId | Banner identifier | string | All-Time |
Understanding the Metrics
The Ad Set Detail Metrics provide insights into various aspects of your ad set performance:
Performance Metrics
- Impressions: Total number of times your products were displayed
- Clicks: Total number of clicks received
- Reach: Number of unique users reached by the banner
- Frequency: Average number of times each user saw the banner
Financial Metrics
- Amount Spent: Total amount spent on the product
- Average CPC: Average cost per click for the product
- Average CPA: Average cost per acquisition
- Average CPM: Average cost per thousand impressions
- Discount: Discount amount applied to the product
Sales Metrics
- Sponsored Units Sold: Number of units sold through sponsored ads
- Attributed Revenue: Total revenue attributed to the sponsored product
- ROAS (Return on Ad Spend): Return on investment for the product
Example Usage (JavaScript)
// First, obtain an access token using OAuth 2.0 client credentials flow
const getAccessToken = async () => {
const response = await fetch('{BASE_URL}/connect/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET',
grant_type: 'client_credentials'
})
});
const data = await response.json();
return data.access_token;
};
// Then, make the API request
const getAdSetDetailMetrics = async () => {
const accessToken = await getAccessToken();
const response = await fetch(
'{BASE_URL}/retail-media/supplier/{supplierId}/retailers/{retailerId}/campaign/{campaignId}/adset-details-metrics',
{
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
}
);
const data = await response.json();
console.log(data);
};
Best Practices
- Regular Monitoring: Check ad set metrics daily to ensure optimal performance
- Performance Analysis: Use impressions and clicks to optimize product visibility
- ROAS Tracking: Monitor ROAS to ensure product-level profitability
- Budget Management: Track amount spent against performance metrics
- Product Performance: Analyze which products perform best in different placements
- Placement Optimization: Use placement data to optimize product positioning
- Banner Analysis: Monitor reach and frequency metrics to understand banner effectiveness
- Revenue Attribution: Track attributed revenue to understand conversion effectiveness
- Cost Analysis: Monitor CPC, CPA, and CPM to optimize cost efficiency
- Discount Impact: Analyze how discounts affect product performance