What is Amazon Marketing Cloud?

Amazon Marketing Cloud (AMC) is Amazon's clean room analytics environment that lets advertisers run custom SQL queries across their advertising and retail data. Unlike standard Amazon reporting, AMC lets you join purchase history with ad impressions, clicks, and conversions at the user level, unlocking insights like customer lifetime value, cross-sell paths, organic vs. paid acquisition, and full-funnel attribution.

This guide provides 15 production-tested SQL queries that you can copy and run directly in your AMC instance. Each query has been optimized for AMC's SQL dialect, tested against real data, and includes analysis recommendations for turning raw output into actionable insights.

Who This Guide Is For

This guide is for Amazon advertisers, brand managers, and agencies who have access to AMC and want to build customer analytics, LTV reports, or attribution models. You should be comfortable with basic SQL concepts (SELECT, JOIN, GROUP BY), though every query is provided ready to run.

Key AMC Rules & Gotchas

AMC has a unique SQL dialect with specific limitations, reserved words, unit conversions, and date column traps that will save you hours of debugging. For the full reference, see the AMC Complete Reference Guide →

Paid vs. Free AMC Tables

Not all AMC tables are available on the free tier. Amazon offers paid data subscriptions (such as Flexible Shopping Insights) that unlock additional tables beyond what's included with base AMC access. If you try to run a query that references a paid table you haven't subscribed to, the query will fail with an error.

The Four Query Categories

The 15 queries are organized into four categories, each targeting a different aspect of your Amazon business:

📊
Revenue & Customer Analytics
3 queries
  • Q1 Monthly Revenue & Customers
  • Q2 Purchase Frequency
  • Q3 Subscribe & Save
💰
Customer Lifetime Value
3 queries
  • Q4 Cohort LTV Analysis
  • Q5 Cross-Sell Paths
  • Q6 Time to Second Purchase
📈
Ad Spend Tracking
3 queries
  • Q7 Sponsored Ads Spend
  • Q8 DSP Spend by Campaign
  • Q9 SB/SBV/SD Spend
🎯
Attribution & Acquisition
6 queries
  • Q10 Organic vs Paid First Touch
  • Q11 Full-Funnel Attribution
  • Q12 Organic vs Paid by ASIN
  • Q13 NTB vs Repeat by ASIN
  • Q14 First-Touch Attribution
  • Q15 Path to Purchase

How AMC Data Flows

Understanding the end-to-end workflow, from raw AMC tables to actionable dashboards:

🗄️
AMC Tables
amazon_attributed_events dsp_impressions sponsored_ads_traffic amazon_retail_purchases dsp_clicks
⚡
AMC Queries
SQL queries run inside AMC UI 15 ready-to-run
📤
CSV Export
Download results as CSV files
📊
Excel / Sheets
Pivot tables Charts & graphs Filter & sort

Quick Reference Table

All 15 queries at a glance. Click any query name to jump to its full documentation.

# Query Name Category Tables Used Subscription Est. Rows
Q1 Monthly Revenue & Customers by ASIN Revenue amazon_retail_purchases ~600
Q2 Purchase Frequency Distribution Revenue amazon_retail_purchases ~5
Q3 Subscribe & Save Analysis Revenue conversions_all ~5,600
Q4 Cohort LTV Analysis LTV amazon_retail_purchases ~1,800
Q5 Cross-Sell Paths LTV amazon_retail_purchases ~4,600
Q6 Time to Second Purchase LTV amazon_retail_purchases ~185
Q7 Sponsored Ads Spend by ASIN Spend sponsored_ads_traffic ✓ Free ~1,500
Q8 DSP Spend by Campaign Spend dsp_impressions ✓ Free ~175
Q9 SB/SBV/SD Spend by Campaign Spend sponsored_ads_traffic ✓ Free ~200
Q10 Organic vs Paid First Touch Attribution amazon_retail_purchases sponsored_ads_traffic dsp_clicks ~120
Q11 Full-Funnel Attribution Attribution amazon_attributed_events_by_conversion_time ✓ Free ~19,000
Q12 Organic vs Paid by ASIN Attribution amazon_retail_purchases sponsored_ads_traffic dsp_clicks ~3,000–5,000
Q13 NTB vs Repeat by ASIN Attribution amazon_retail_purchases ~5,000–10,000
Q14 First-Touch Attribution by Channel Attribution amazon_attributed_events_by_conversion_time sponsored_ads_traffic dsp_impressions ✓ Free ~5
Q15 Path to Purchase Attribution sponsored_ads_traffic dsp_impressions amazon_retail_purchases ~500–2,000

Revenue & Customer Analytics

These queries extract core business metrics from amazon_retail_purchases: monthly revenue, customer counts, purchase frequency, and subscription data. They form the foundation of any AMC analytics setup.

Customer Lifetime Value

These queries analyze customer behavior over time: cohort retention, cross-sell paths, and repurchase timing. Together they paint a complete picture of how customers interact with your brand after their first purchase.

✦ ADLABS FEATURE

Semi-Automatic Campaign Management

You set the targets and guardrails. AdLabs handles bid optimization with math you can check, keeps your campaign structure clean with two-click harvesting, and logs every change. Spend less time in the weeds and more time scaling what works.

Try Free →
AdLabs Amazon PPC management platform

Ad Spend Tracking

These queries pull ad spend from Sponsored Ads and DSP, broken down by ASIN and campaign. Combined with the revenue queries in Category 1, they let you calculate true Customer Acquisition Cost (CAC) and ROAS at the product level.

Attribution & Acquisition

The most powerful queries in the library. These join purchase data with ad interaction data to determine how customers were acquired (organic vs. paid), attribute conversions to specific campaigns, and classify buyers as new-to-brand or repeat, all at the product level.

✦ ADLABS FEATURE

Custom Dashboards & Reporting

Live, white-label dashboards that track TACOS with retail, ads, DSP, SQP and AMC widgets across your catalog. Stop sending static spreadsheets; give clients and stakeholders real-time access to the metrics that matter.

Try Free →
AdLabs custom reporting dashboards for Amazon sellers

AMC Tables Reference

The five core AMC tables used across this query library. Each table contains many more columns than listed here; these are the key columns relevant to the queries in this guide.

amazon_retail_purchases

The core retail purchases table. Contains every purchase made by customers of your brand on Amazon. Used by 9 of the 15 queries in this library.

ColumnTypeNotes
user_idTEXT⛔ Non-viewable; used for JOINs and COUNT(DISTINCT) only
asinTEXTProduct ASIN
asin_nameTEXTProduct name
purchase_date_utcTIMESTAMPPurchase date; use with DATE_TRUNC
purchase_dt_utcTIMESTAMPPurchase datetime; use for SECONDS_BETWEEN
purchase_day_utcINTEGERDay number; usable for ORDER BY in window functions
purchase_idTEXTUnique order identifier
unit_priceDECIMALPrice per unit in dollars (already converted)
purchase_units_soldINTEGERUnits in this line item
purchase_program_nameTEXTSubscribe & Save indicator (may be empty)

sponsored_ads_traffic

All Sponsored Products, Sponsored Brands, and Sponsored Display traffic events: impressions, clicks, and spend. Used by Q7, Q9, Q10, Q12, Q14, and Q15.

ColumnTypeNotes
user_idTEXT⛔ Non-viewable
event_date_utcTIMESTAMPUse this for DATE_TRUNC (not event_day_utc)
creative_asinTEXTASIN shown in the ad; may be empty for SB/SD
ad_product_typeTEXTsponsored_products, sponsored_brands, sponsored_display
campaignTEXTCampaign name
campaign_idTEXTCampaign ID
spendBIGINT⚠️ In microcents; divide by 100,000,000 for dollars
clicksINTEGERNumber of clicks
impressionsINTEGERNumber of impressions

dsp_impressions

DSP impression-level data with spend information. Used by Q8 for DSP spend tracking, and by Q14 and Q15 for touchpoints.

ColumnTypeNotes
user_idTEXT⛔ Non-viewable
impression_date_utcTIMESTAMPUse this for DATE_TRUNC (not impression_day_utc)
campaignTEXTDSP campaign name
campaign_idTEXTDSP campaign ID
total_costBIGINT⚠️ In millicents; divide by 100,000 for dollars
impressionsINTEGERNumber of impressions

dsp_clicks

DSP click-level data. Used by Q10 and Q12 to determine if a customer was "ad-touched" via DSP.

ColumnTypeNotes
user_idTEXT⛔ Non-viewable
click_date_utcTIMESTAMPClick timestamp
campaignTEXTDSP campaign name
clicksINTEGERNumber of clicks

amazon_attributed_events_by_conversion_time

Amazon's attribution table, the largest table (392 columns). Links ad traffic to conversion events. Used by Q11 for full-funnel attribution and by Q14 for conversions.

ColumnTypeNotes
user_idTEXT⛔ Non-viewable
conversion_event_date_utcTEXT⚠️ Requires CAST(... AS TIMESTAMP) before DATE_TRUNC
ad_product_typeTEXTAd type that drove the conversion (NULL for DSP)
campaignTEXTCampaign name
tracked_asinTEXTASIN attributed to the conversion
new_to_brandBOOLEANAmazon's NTB flag
purchasesINTEGERNumber of attributed purchases
total_product_salesDECIMALTotal attributed sales revenue
new_to_brand_purchasesINTEGERNTB purchase count
new_to_brand_total_product_salesDECIMALNTB revenue

Written by

AdLabs team

Amazon Ads Verified Partner

Amazon PPC software for brands and agencies, used by 6,500+ advertisers.