Amazon DSP CAPI
What Is Amazon DSP CAPI?
Amazon DSP (Demand Side Platform) allows advertisers to programmatically buy display, video, and audio ads both on and off Amazon. The Conversion API (CAPI) for Amazon DSP enables advertisers to send conversion events directly from their servers to Amazon Ads, bypassing the need for browser-based tracking.
Product Type: Advertising
Integration Type: Starter Kit
Event Source Type: Web
Event Scope: Full-Funnel Events
Capabilities
- Sends server-to-server conversion events to Amazon DSP
- Supports custom event mapping using Conversion Definition IDs
- Enables matching using hashed emails or user IDs
- Allows deduplication using client-defined message IDs
Considerations
- Conversion Definition IDs must be obtained from Amazon Ads
- While you may reuse your existing conversion definitions for server-side events, we recommend creating new, clearly labeled off-Amazon conversions for testing and validation. This helps ensure that incoming events can be easily identified in the conversions dashboard, especially during initial setup or troubleshooting.
- Requires OAuth2 credentials and refresh token for authentication
- Conversion events must include at least a hashed email or user ID
- Hashed email, hashed phone number, or another supported identifier is available for all conversions sent to the Conversions API. View the full list of supported parameters
- Events missing identity data will be dropped by the integration
- Events older than 7 days will be rejected
Limitations
- Cannot trigger Amazon-native tracking pixels or UI widgets
Prerequisites
Before setting up the Amazon DSP CAPI integration, ensure the following:
- Access to a self-service advertiser account in the Amazon DSP
- Advertiser Audience Agreement has been accepted
If you have not yet accepted the terms and conditions:- Go to https://advertising.amazon.com and navigate to the Amazon DSP console
- Select your entity and advertiser
- Go to Events Manager from the left-hand menu
- You’ll be prompted to read and accept the Advertiser Audience Agreement Terms and Conditions
- If you are not prompted, the terms have already been accepted
Starter Kit Setup Guide
1. Gather Credentials
To use the Amazon DSP CAPI integration, you must collect the following credentials:
Client ID & Client Secret
- Go to https://developer.amazon.com
- Navigate to Developer Console → Login with Amazon on the top navigation
- If needed, create a new Security Profile
- On the Security Profile, click Show Client ID and Client Secret
- Save both for use in the Starter Kit
NOTE: Please ensure that your developer account has the campaign management scope enabled before proceeding. Use the Advanced Tool Center to view scopes assigned to your security profile.
Redirect URL Setup
-
Click the Manage icon next to your Security Profile
-
Under Web Settings, add your allowed return URLs
Examples:
https://www.amazon.com
https://www.metarouter.io
Obtain Code
- Navigate to the following URL in your browser:
https://www.amazon.com/ap/oa?scope=advertising::campaign_management&response_type=code&client_id=<CLIENT_ID>&state=State&redirect_uri=<REDIRECT_URL>
- Replace the placeholders with your actual values.
- After approval, copy the
code
value from the redirect URL.
Get Access & Refresh Tokens
- Use the following cURL request in Postman to obtain your tokens:
curl --location 'https://api.amazon.com/auth/o2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=<STEP_1_CODE>' \
--data-urlencode 'redirect_uri=<REDIRECT_URI>' \
--data-urlencode 'client_id=<CLIENT_ID>' \
--data-urlencode 'client_secret=<CLIENT_SECRET>'
- Replace:
- <STEP_1_CODE> with the code you got in Step 3
- <REDIRECT_URI> with your return URL
- <CLIENT_ID> and <CLIENT_SECRET> from Step 1
- Sample Response (truncated access token, please include the full token in your cURL):
{ "access_token": "**Atza|IwE…"**, "refresh_token": "Atzr|IwE…", "token_type": "bearer", "expires_in": 3600 }
- Copy the Access Token and Refresh Token and save it for the next steps
Get Profile ID
- Run the following request in Postman:
curl --location 'https://advertising-api.amazon.com/v2/profiles' \
--header 'Amazon-Advertising-API-ClientId: <CLIENT_ID>' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'
- Replace <CLIENT_ID> and <ACCESS_TOKEN> with your values.
- Sample Response (truncated):
[ { "profileId": **32312945...**, "countryCode": "US", "currencyCode": "USD", "timezone": "America/Los_Angeles", "accountInfo": { "marketplaceStringId": "ATV...", "id": "ENTITY1B...", "type": "agency", "name": "MetaRouter" } } ]
- Sample Response (truncated):
- Save the value of the Profile ID, which is required in the Amazon DSP CAPI Starter Kit.
Get Advertiser ID
- Log in to your Amazon Ads account → Administration → Accounts
- Copy the numeric account ID under your account name.
Get Conversion Definition IDs
- In your Amazon Ads account, go to Data Manager → Destinations
- You can create a new off-Amazon conversion or copy an existing Conversion ID
- These IDs must be mapped to specific events in your Amazon DSP CAPI starter kit
2. Add an Amazon DSP CAPI Integration
From the integration library, add a Amazon DSP CAPI integration. Then, fill out the Connection Parameters:
Connection Parameter | Description |
---|---|
BASE_URL | Base URL for the Amazon Ads API (default: https://advertising-api.amazon.com ). For regional base URLS please see here: Regions base URLs |
ADVERTISER_ID | Numeric ID of your Amazon Ads account |
CLIENT_ID | OAuth2 client ID from Amazon Developer Console |
CLIENT_SECRET | OAuth2 client secret from Amazon Developer Console |
PROFILE_ID | Amazon Ads Profile ID |
REFRESH_TOKEN | OAuth2 refresh token used to obtain access tokens |
3. Configure Event Mapping
- MetaRouter provides all of the event mappings that Amazon DSP CAPI integrations typically require. You may add custom events, parameters, or mappings in accordance with Amazon Ads API documentation.
4. Deploy to Pipeline
- In the Pipelines tab, add your Amazon DSP CAPI integration.
- Select the correct integration revision
- Click Add Integration to finalize deployment.
Event Mappings
Global
Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.
Output Key | Description | Expected Input |
---|---|---|
name Required | String: Normalized name of the event | Expression – maps track calls to lowercase with underscores |
matchKeys Required | Array: Contains hashed email or user ID used for matching—must include at least 1 identity | Expression – hashes traits.email or userId |
clientDedupeId | String: Unique ID for deduplication | messageId |
timestamp Required | Integer: Timestamp of the event in epoch seconds | timestamp |
countryCode Required | String: Country code of the user | Enrichment – US |
Event Specific
Page
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Products Searched
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Product List Viewed
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Product Clicked
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Product Viewed
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Product Added
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Product Removed
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Cart Viewed
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
Order Completed
Output Key | Description | Expected Input |
---|---|---|
conversionDefinitionId Required | String: Conversion definition ID assigned by Amazon Ads | Enrichment – ADD_CONVERSION_DEFINITION_ID_HERE |
value | Float: Total order value | Expression – sum of product values |
currencyCode | String: ISO currency code | properties.currency , modified to uppercase |
unitsSold | Integer: Total quantity of items sold | Expression – sum of product quantities |
Required & Recommended Identifiers
These identifiers must be mapped to Amazon DSP CAPI in order for successful user matching to occur. Without these IDs, any events sent to Amazon Ads may not be accurately reflected in reporting.
Attribute | Example | Sync Injector Required? |
---|---|---|
email_hash Required | e1a2b3c4d5... | No |
userId Recommended | user_abc123 | No |
Integration Validation
To validate events from the Amazon DSP CAPI integration, go to Data Manager > Destinations, click the name of your off-Amazon conversion, and check the conversions dashboard for incoming events.
Additional Amazon DSP CAPI Documentation
Updated 3 days ago