Chord Event Tracking
Getting started
SDK API reference
41 min
complete reference for all tracking methods available in the @chordcommerce/analytics library page views chord page() sends a page view event to chord chord page() user identity chord identify(userid, traits) sends an identify event to associate a user with their traits call this after account creation, login, or when a user submits identifying information chord identify(userid, { email, phone, firstname, lastname }) // or without userid chord identify({ email, phone }) property type required description userid string no the user's unique identifier traits object no user traits (email, phone, name, etc ) best practice send identify before track events when both occur at the same time some downstream integrations require identity to be established before processing track events chord reset() resets the user session the user receives a new anonymous identifier and previous user data is cleared call this after logout chord reset() product events chord trackproductviewed({ cart, product }) sends a "product viewed" event call this whenever a product page is viewed property type required description cart any yes the current cart product product any yes product and variant details product position number no position in a list product quantity number no quantity product variantid any no product variant identifier chord trackproductadded({ cart, product }) sends a "product added" event when a product is first added to cart (not for quantity changes) same parameters as trackproductviewed chord trackproductremoved({ cart, lineitem }) sends a "product removed" event when a product is removed from cart property type required description cart any yes the cart after removal lineitem any yes the removed line item chord trackproductclicked({ cart, product, listid, listname }) sends a "product clicked" event when a product link is clicked property type required description cart any yes the current cart product product any yes product details product position number no position in the list listid any no list identifier listname string no list name chord trackproductlistviewed({ category, listid, listname, products }) sends a "product list viewed" event property type required description category string no product category listid string no list identifier listname string no list name products array yes products in the list chord trackproductlistfiltered({ category, listid, listname, filters, sorts }) sends a "product list filtered" event when filters are applied property type required description category string no product category listid string no list identifier listname string no list name filters array no applied filters ( \[{ type, value }] ) sorts array no applied sorts ( \[{ type, value }] ) chord trackproductssearched({ query }) sends a "products searched" event property type required description query string no search query productid any no product id searched for currency string no iso 4217 currency code price number no product price quantity number no quantity cart events chord trackcartviewed({ cart }) sends a "cart viewed" event property type required description cart any yes the current cart checkout events chord trackcheckoutstarted({ checkout }) sends a "checkout started" event property type required description checkout any yes the current checkout chord trackcheckoutstepviewed({ checkoutid, step }) sends a "checkout step viewed" event property type required description checkoutid string yes checkout identifier step number yes step number paymentmethod string no payment method shippingmethod string no shipping method chord trackcheckoutstepcompleted({ checkoutid, step }) sends a "checkout step completed" event same parameters as trackcheckoutstepviewed chord trackpaymentinfoentered({ checkoutid, step }) sends a "payment info entered" event property type required description checkoutid string no checkout identifier step number yes step number paymentmethod string no payment method used shippingmethod string no shipping method coupon string no coupon code currency string no currency code orderid string no order identifier value number no total value products array no products in checkout order events chord trackordercompleted({ orderid, orderdate, currency, revenue, total, products }) sends an "order completed" event property type required description orderid string yes order identifier orderdate string yes date of completion currency string yes currency code revenue number yes revenue (subtotal) total number yes total with discounts/coupons products array yes products in the order coupon events chord trackcouponapplied({ cartid, couponid, couponname, discount, orderid }) sends a "coupon applied" event after successful application property type required description cartid string no cart identifier couponid string no coupon identifier couponname string no coupon name discount number no monetary discount amount orderid string no order identifier chord trackcoupondenied({ cartid, couponid, couponname, orderid, reason }) sends a "coupon denied" event same parameters as trackcouponapplied , plus reason ( string , optional) chord trackcouponentered({ cartid, couponid, couponname, discount, orderid }) sends a "coupon entered" event immediately after entry, before approval/denial same parameters as trackcouponapplied chord trackcouponremoved({ cartid, couponid, couponname, discount, orderid }) sends a "coupon removed" event same parameters as trackcouponapplied email & login events chord trackemailcaptured({ email, placementcomponent, placementpage }) sends an "email captured" event when a customer enters an email address property type required description email string no email address captured placementcomponent string no ui component identifier (e g , footer newsletter ) placementpage string no page identifier (e g , homepage ) chord trackloginstarted({ email }) sends a "login started" event property type required description email string no email used for login authentication events chord tracksignedin({ email, method }) sends a "signed in" event after successful login property type required description email string no user's email method string no login method chord tracksignedup({ email, method }) sends a "signed up" event after successful signup same parameters as tracksignedin chord tracksignedout({ email }) sends a "signed out" event after successful logout property type required description email string no user's email navigation events chord tracknavigationclicked({ category, label, navigationplacement, navigationtitle, navigationurl }) sends a "navigation clicked" event property type required description category string no navigation category label string no navigation label navigationplacement string no placement (e g , header , footer ) navigationtitle string no navigation title navigationurl string no target url variant events chord trackvariantclicked({ product, cart, lineitemid, coupon }) sends a "variant clicked" event property type required description product any yes the variant clicked cart any yes the current cart lineitemid string no line item identifier coupon string no coupon code subscription events chord tracksubscriptioncancelled({ subscriptionid, }) sends a "subscription cancelled" event property type required description subscriptionid string no subscription identifier email string no associated email brand string no associated brand currency string no currency code intervallength number no subscription interval length intervalunits string no interval units (e g , month ) state string no subscription state products array no products in subscription actionabledate string no actionable date enddate string no end date address object no associated address generic track method chord track(eventname, properties) sends a custom event directly to chord this bypasses formatters and sends properties as is chord track('custom event name', { custom property 'value', another property 123, }) important this method does not use formatters or transform property names use snake case for all property names prefer event specific methods when available