We have custom attributes for the addtocart value, sku, and qty. We also have custom insights events for orders and lineItems.
On a “Sales Trends” board we have these queries:
SELECT sum(grandTotal),sum(AddToCartValue) FROM Transaction, OrderHeader where appName='Prod' SINCE 1 day ago
SELECT sum(AddToCartValue) from Transaction where appName = 'Prod' and AddToCartValue is not null TIMESERIES 1 hour since 1 day ago
- Top 10 Product Page Views (we have a custom attribute that saves the product name and sku to APM.
SELECT count(ProductName) from Transaction where appName='Prod' and ProductName is NOT NULL and name='product page transaction (GET)' since 6 hours ago FACET ProductName TIMESERIES AUTO
- Product Page View By Category (custom attribute on product page for product category)
SELECT count(ProductCatCode) FROM Transaction WHERE ProductCatCode is not null and appName='Prod' and name='product page transaction (GET)' FACET ProductCatCode TIMESERIES 30 minutes LIMIT 10 since 2 hours ago
- Add To Cart Clicks By Category
SELECT count(ProductCatCode) FROM Transaction WHERE ProductCatCode is not null and appName='Prod' and AddToCartAmount is not null FACET ProductCatCode TIMESERIES 1 hour LIMIT 12 since 12 hours ago
SELECT sum(checkoutValue) FROM OrderLineItem WHERE ProductCatCode is not null and appName='Prod' FACET ProductCatCode TIMESERIES 1 hour LIMIT 12 since 12 hours ago
- Coupon Codes (custom attribute to store the entered coupon code)
SELECT count(AddToCartCouponCode) from Transaction where AddToCartCouponCode is not null and appName ='Prod' FACET AddToCartCouponCode since 1 day ago
- Top Products Purchased in $
SELECT sum(checkoutValue) from OrderLineItem where appName='Prod' FACET ProductName
- Credit Cards Per Day (custom attribute storing payment type)
select count(paymentType) from OrderHeader where appName='Prod' facet paymentType TIMESERIES 1 day since 10 days ago
- Last Week’s Shipping Methods (custom attribute for shipping type)
SELECT count(shippingMethod) FROM OrderHeader where appName='Prod' FACET shippingMethod SINCE 1 week AGO
I have also use the “Data Apps” to create a series of 3 page with stats for Category, SubCategory, and Product. This allows use to drill down from
SELECT count(ProductCatBuyer) from Transaction where appName='Prod' and name='product page transaction (GET)' FACET ProductCatBuyer since 1 day ago
To the sub cat page with this query:
SELECT sum(checkoutValue) from OrderLineItem where appName='Prod' FACET ProductCatCode since 1 day ago
To a page concentrating on product level stats with queries like:
SELECT sum(checkoutValue) from OrderLineItem where appName='Prod' facet ProductName since 1 day ago limit 30