Puddle Developer Documentation
Analytics (PQL)

Datasets

Every PQL dataset, measure and dimension.

This is the full list of datasets, measures and dimensions you can query. MCP clients can call describe_analytics to get the live list, including whether website data is available for the store.

All money values are integer cents. All datasets also have the time dimensions.

orders

Placed orders (excludes unpaid checkouts and deleted orders). One row per order. Time is when the order was placed.

Measures

MeasureTypeDescription
order_countintegerNumber of placed orders.
revenuemoneyNet revenue: order totals (incl. shipping) minus refunds.
gross_salesmoneyOrder totals before refunds (incl. shipping, after discounts).
product_revenuemoneyNet revenue excluding shipping.
shipping_revenuemoneyShipping charged to customers.
discountsmoneyDiscounts given on orders (promotions and codes).
refundsmoneyAmount refunded.
aovmoneyAverage order value (net revenue ÷ orders).
customersintegerDistinct customers who placed orders (guests counted by email).
registered_buyersintegerDistinct registered customers (accounts) who placed orders.
new_buyersintegerRegistered customers whose first-ever order was placed in the range.
returning_buyersintegerRegistered customers who ordered in the range and had ordered before it.
repeat_buyer_ratepercentReturning buyers ÷ registered buyers × 100.
discounted_ordersintegerOrders with a discount applied.
discount_usage_ratepercentDiscounted orders ÷ orders × 100.

Dimensions

DimensionTypeDescription
statusstringFulfilment status of the order. Values: PENDING, PROCESSING, AWAITING_SHIPMENT, AWAITING_COLLECTION, COLLECTED, SHIPPED, DELIVERED, CANCELLED.
payment_statusstringPayment status of the order. Values: AWAITING_PAYMENT, PAID, PARTIALLY_PAID, REFUNDED, PARTIALLY_REFUNDED.
payment_providerstringPayment provider used, e.g. paystack.
delivery_methodstringDelivery or collection method name chosen at checkout.
provincestringDelivery province (falls back to billing province).
promotion_codestringPromotion code entered at checkout, if any.
customer_typestring'new' for a customer's first placed order, 'returning' if they ordered before, 'guest' for orders without an account. Values: new, returning, guest.
customer_idstringCustomer account UUID (null for guests). Use with entity links.
customerstringCustomer name (account name, or the name on the order for guests).
customer_emailstringCustomer email (account email, or the email on the order for guests).

Plus the time dimensions.

products

Order line items on placed orders (cancelled lines excluded). Use for best sellers and product performance.

Measures

MeasureTypeDescription
units_soldintegerUnits sold.
item_revenuemoneyLine revenue: unit price × quantity minus line discounts.
item_discountsmoneyDiscounts applied to lines.
order_countintegerDistinct orders containing the product.

Dimensions

DimensionTypeDescription
productstringProduct name.
product_idstringProduct UUID (use with entity links).
product_slugstringProduct URL slug. Matches web.product_slug for blending.
product_image_idstringProduct's primary image id (for rendering thumbnails).
variantstringVariant options, e.g. 'Large / Blue'.
product_typestringphysical, digital or gift_card. Values: physical, digital, gift_card.
order_statusstringFulfilment status of the order. Values: PENDING, PROCESSING, AWAITING_SHIPMENT, AWAITING_COLLECTION, COLLECTED, SHIPPED, DELIVERED, CANCELLED.
customer_typestring'new' for a customer's first placed order, 'returning' if they ordered before, 'guest' for orders without an account. Values: new, returning, guest.

Plus the time dimensions.

customers

Customer accounts. Time is when the account was created. For buying behaviour use orders.customers and orders.customer_type.

Measures

MeasureTypeDescription
new_customersintegerAccounts created.
marketing_subscribersintegerAccounts created that accept marketing email.

Dimensions

DimensionTypeDescription
marketing_consentbooleanWhether the customer accepts marketing email.
email_verifiedbooleanWhether the customer verified their email.

Plus the time dimensions.

carts

Shopping carts. Time is the cart's last activity. A cart is abandoned if it was not converted or emptied and has been idle for over an hour.

Measures

MeasureTypeDescription
cartsintegerCarts with activity in the period.
converted_cartsintegerCarts that became an order.
abandoned_cartsintegerCarts left idle for over an hour without converting.
cart_conversion_ratepercentConverted carts ÷ carts × 100.

Dimensions

DimensionTypeDescription
cart_ownerstringWhether the cart belongs to a signed-in customer or a guest. Values: customer, guest.

Plus the time dimensions.

web

Storefront web traffic: pageviews, visitors, visits, bounces and custom events.

Measures

MeasureTypeDescription
pageviewsintegerPage views.
visitorsintegerUnique visitors (sessions).
visitsintegerVisits (a session can have several visits).
bouncesintegerVisits with a single pageview.
bounce_ratepercentBounces ÷ visits × 100.
avg_visit_secondsdurationAverage visit duration in seconds.
eventsintegerCustom events (group by event_name).
event_visitorsintegerUnique visitors who triggered a custom event.

Dimensions

DimensionTypeDescription
pathstringPage path, e.g. /products/linen-shirt.
page_titlestringPage title.
hostnamestringSite hostname.
referrerstringReferring domain (null for direct traffic).
utm_sourcestringutm_source parameter.
utm_mediumstringutm_medium parameter.
utm_campaignstringutm_campaign parameter.
utm_contentstringutm_content parameter.
utm_termstringutm_term parameter.
event_namestringCustom event name (null for pageviews). Use with the events measure.
product_slugstringProduct slug for /products/:slug pages, else null. Matches products.product_slug.
devicestringdesktop, laptop, tablet or mobile.
browserstringBrowser name.
osstringOperating system.
countrystringISO country code, e.g. ZA.
regionstringISO region code, e.g. ZA-GP.
citystringCity name.
languagestringBrowser language.

Plus the time dimensions.

blend

Combines commerce and web data. Use derived measures below, or any measure of the orders, products and web datasets as dataset.measure (e.g. orders.revenue, web.visitors). Only conformed dimensions can be used.

Measures

MeasureTypeDescription
conversion_ratepercentOrders ÷ web visits × 100.
revenue_per_visitormoneyNet revenue ÷ unique visitors.
view_to_purchase_ratepercentOrders containing a product ÷ visits to product pages × 100. Group by product_slug for per-product rates.
orders.<measure>numberAny measure of the 'orders' dataset.
products.<measure>numberAny measure of the 'products' dataset.
web.<measure>numberAny measure of the 'web' dataset.

Dimensions

DimensionTypeDescription
time.hourdateHour (store timezone).
time.daydateDay (store timezone).
time.weekdateISO week, labelled by its Monday.
time.monthdateMonth.
time.yeardateYear.
time.day_of_weekinteger1 = Monday … 7 = Sunday.
time.hour_of_dayinteger0–23.
product_slugstringProduct slug. Only valid with product-level measures (products., web., view_to_purchase_rate).

How blending works

A blend query is split into one sub-query per dataset. Each is scoped to the store and uses the same range, filters and dimensions. The rows are merged on the dimension values, and derived measures are then computed per row. A dataset with no row for a key counts as 0. A ratio with a zero denominator is null.

Only conformed dimensions (the same key on both sides) can be used: the time dimensions, and product_slug for product-level measures. Each sub-query is capped at 5,000 rows before merging.

On this page