customer_entity Table
The customer_entity table contains records of all registered accounts. An account is considered registered if they sign up for an account, regardless of whether they ever complete a purchase. Each row corresponds to one unique registered account, as identified by that account’s entity_id.
This table does not contain records of customers who place an order via guest checkout. If your store accepts guest checkout, see how to account for guest orders for those orders.
Common Columns
Column Name
Description
created_atTimestamp corresponding to the account’s registration date, stored locally in UTC. Depending on your configuration in Commerce Intelligence, this timestamp may be converted to a reporting time zone in Commerce Intelligence that differs from your database time zone
emailEmail address associated with the account
entity_id (PK)Unique identifier for the table, and commonly used in joins to the
customer_id in other tables within the instancegroup_idForeign key associated with the
customer_group table. Join to customer_group.customer_group_id to determine the customer group associated with the registered accountstore_idForeign key associated with the
store table. Join to store.store_id to determine which Commerce store view is associated with the registered accountCommon Calculated Columns
Column Name
Description
Customer's first 30 day revenueSum total of revenue for all orders placed by this customer within 30 days of the customer’s first order date. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and summing the base_grand_total field for all orders where sales_order.Seconds between customer's first order date and this order ≤ 2592000, which is the number of seconds in 30 daysCustomer's first order dateTimestamp of the first order placed by this customer. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and returning the minimum sales_order.created_at valueCustomer's first order's billing regionBilling region associated with the customer’s first order. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and returning the Billing address region where sales_order.Customer's order number = 1Customer's first order's coupon_codeCoupon code associated with the customer’s first order. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and returning the sales_order.coupon_code where sales_order.Customer's order number = 1Customer's group codeGroup name of the registered customer. Calculated by joining
customer_entity.group_id to customer_group.customer_group_id and returning the customer_group_code fieldCustomer's lifetime number of couponsTotal number of coupons applied to all orders placed by this customer. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and counting the number of orders where the sales_order.coupon_code is not NULLCustomer's lifetime number of ordersTotal count of orders placed by this customer. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and counting the number of rows in the sales_order tableCustomer's lifetime revenueSum total of revenue for all orders placed by this customer. Calculated by joining
customer_entity.entity_id to sales_order.customer_id and summing the base_grand_total field for all orders placed by this customerSeconds since customer's first order dateElapsed time between the customer’s first order date and now. Calculated by subtracting
Customer's first order date from the server timestamp at the time the query is executed, returned as an integer number of secondsStore nameThe name of the Commerce store associated with this registered account. Calculated by joining
customer_entity.store_id to store.store_id and returning the name fieldCommon Metrics
Metric Name
Description
Construction
Avg first 30 day revenueThe average revenue per customer for orders placed within 30 days of the customer’s first order
Operation: Average
Operand:
Timestamp:
Filters:
- [A]
Operand:
Customer's first 30 day revenueTimestamp:
created_atFilters:
- [A]
Seconds since customer's first order date ≥ 2592000 (excludes customers who have not yet reached 30 days since their first order)Avg lifetime couponsThe average number of coupons applied to orders per customer over their lifetime
Operation: Average
Operand:
Timestamp:
Operand:
Customer's lifetime number of couponsTimestamp:
created_atAvg lifetime ordersThe average number of orders placed per customer over their lifetime
Operation: Average
Operand:
Timestamp:
Operand:
Customer's lifetime number of ordersTimestamp:
created_atAvg lifetime revenueThe average total revenue per customer for all orders placed over their lifetime
Operation: Average
Operand:
Timestamp:
Operand:
Customer's lifetime revenueTimestamp:
created_atNew customersThe number of customers with at least one order, counted on the date of their first order. Excludes accounts who register but never place an order
Operation: Count
Operand:
Timestamp:
Operand:
entity_idTimestamp:
Customer's first order dateRegistered accountsThe number of accounts registered. Includes all registered accounts, regardless of whether the account ever placed an order
Operation: Count
Operand:
Timestamp:
Operand:
entity_idTimestamp:
created_atForeign Key Joining Paths
customer_group
- Join to
customer_grouptable to create columns that return the customer group name of the registered account.- Path:
customer_entity.group_id(many) =>customer_group.customer_group_id(one)
- Path:
store
- Join to
storetable to create columns that return details related to the store associated with registered account.- Path:
customer_entity.store_id(many) =>store.store_id(one)
- Path:
recommendation-more-help
e1f8a7e8-8cc7-4c99-9697-b1daa1d66dbc