Cart ID
Also known as: Cart Identifier
An opaque shopping cart identifier recorded on each add-to-cart action. It groups additions by cart so teams can investigate shopping activity and cart issues.
Business Use Case
1️⃣ E-commerce teams group additions by cart to investigate repeated cart activity. 2️⃣ Cart teams inspect a cart's additions when investigating reported shopping issues.
Business Criticality
High
Journey / Navigation Area
Cart
Owning Function
E-commerce Operations
Scope
Event
Measurement Channels
Web, Mobile App, Backend / API
Formula
Calculation Notes
1️⃣ Return the collected Cart ID unchanged on each qualifying add-to-cart action. 2️⃣ Repeated Cart IDs group actions; they do not identify people. 3️⃣ Missing Cart IDs do not qualify for the segment population. 4️⃣ Preserve historical action values when carts merge or identifiers change. 5️⃣ Include actions from report start up to, but excluding, report end.
Technical Details
Events
| Platform | Event |
|---|---|
| Google Analytics 4 | add_to_cart — supplies the shopping cart identifier |
| Adobe | commerce.productListAdds — supplies the shopping cart identifier |
Data Mappings
W3 Data Layer
{
"digitalData": {
"event": [
{
"eventInfo": {
"eventName": "add_to_cart",
"timeStamp": "2026-10-29T12:00:00Z"
},
"attributes": {
"event_id": "cart-add-A123"
}
}
],
"cart": {
"cartID": "C123",
"item": [
{
"productInfo": {
"productID": "SKU123"
},
"quantity": 2
},
{
"productInfo": {
"productID": "SKU456"
},
"quantity": 1
}
]
}
}
}GA4 Data Layer
[
{
"event": "add_to_cart",
"event_id": "cart-add-A123",
"cart_id": "C123",
"ecommerce": {
"items": [
{
"item_id": "SKU123",
"quantity": 2
},
{
"item_id": "SKU456",
"quantity": 1
}
]
}
}
]Adobe Client Data Layer
[
{
"event": "commerce.productListAdds",
"eventInfo": {
"eventId": "cart-add-A123",
"timestamp": "2026-10-29T12:00:00Z"
},
"commerce": {
"productListAdds": {
"value": 1
},
"cart": {
"cartID": "C123"
}
},
"productListItems": [
{
"SKU": "SKU123",
"quantity": 2
},
{
"SKU": "SKU456",
"quantity": 1
}
]
}
]XDM Mapping
[
{
"_id": "cart-add-A123",
"timestamp": "2026-10-29T12:00:00Z",
"eventType": "commerce.productListAdds",
"commerce": {
"productListAdds": {
"value": 1
},
"cart": {
"cartID": "C123"
}
},
"productListItems": [
{
"SKU": "SKU123",
"quantity": 2
},
{
"SKU": "SKU456",
"quantity": 1
}
]
}
]SQL Queries
Google Analytics 4 (BigQuery)
-- Bind report_start and report_end as UTC TIMESTAMP parameters.
-- Source action uniqueness and replay-conflict resolution are integration prerequisites.
WITH cart_actions AS (
SELECT
(SELECT p.value.string_value FROM UNNEST(event_params) AS p
WHERE p.key = 'event_id') AS event_id,
TIMESTAMP_MICROS(event_timestamp) AS action_time,
(SELECT p.value.string_value FROM UNNEST(event_params) AS p
WHERE p.key = 'cart_id') AS cart_id
FROM `{{GA4_PROJECT}}.{{GA4_DATASET}}.events_*`
WHERE event_name = 'add_to_cart'
AND _TABLE_SUFFIX BETWEEN
FORMAT_DATE('%Y%m%d', DATE_SUB(DATE(@report_start), INTERVAL 1 DAY))
AND FORMAT_DATE('%Y%m%d', DATE_ADD(DATE(@report_end), INTERVAL 1 DAY))
AND event_timestamp >= UNIX_MICROS(@report_start)
AND event_timestamp < UNIX_MICROS(@report_end)
)
SELECT event_id, action_time, cart_id
FROM cart_actions
WHERE cart_id IS NOT NULL;Adobe Experience Platform (AEP Query Service)
-- Substitute report bounds as UTC timestamp literals; use a UTC query session.
-- Source action uniqueness and replay-conflict resolution are integration prerequisites.
SELECT
_id AS event_id,
timestamp AS action_time,
commerce.cart.cartID AS cart_id
FROM {{AEP_EXPERIENCE_EVENT_DATASET}}
WHERE eventType = 'commerce.productListAdds'
AND timestamp >= CAST('{{REPORT_START_UTC}}' AS TIMESTAMP)
AND timestamp < CAST('{{REPORT_END_UTC}}' AS TIMESTAMP)
AND commerce.cart.cartID IS NOT NULL;Source Data
Digital Analytics, Commerce Platform
Dependencies
Prerequisite: List the dependencies required for this Dimension
Events:
Report Attributes
Cart ID
Segment Eligibility
Cart ID EXISTS
Governance
Governance
GitHub
catalog/dimensions/cart-id.yml