Menu
Menu Sheet Overlay
Search
Search Sheet

      Analytics Schema

      Analytics Data Objects are convenient objects with the following functionalities:

      • Standardized data format that Analytics Connectors receive
      • Define requirements for a particular Analytics Connector
      • Sanitize and normalize identified numeric fields

      For example, you can create a Page data object as follows:

      const page = new Page({
          [Page.TEMPLATENAME]: 'home'
      })
      
      // Result:
      // page = {
      //     templateName: 'home'
      // }

      However, if you provide invalid keys, the invalid keys will not be included in the output.

      const page = new Page({
          [Page.TEMPLATENAME]: 'home',
          someKey: 'some value'
      })
      
      // Result:
      // page = {
      //     templateName: 'home'
      // }

      You can set requirements when creating these data objects.

      const page = new Page({
          [Page.TEMPLATENAME]: 'home',
          [Page.TITLE]: 'page title'
      }, [Page.TEMPLATENAME])
      
      // Result:
      // page = {
      //     templateName: 'home',
      //     title: 'page title'
      // }
      
      const page = new Page({
          [Page.TITLE]: 'page title'
      }, [Page.TEMPLATENAME])
      
      // Result: An error will be thrown

      You can remap the key names and set default values as well

      const page = new Page({
          [Page.TITLE]: 'page title'
      }, [Page.TEMPLATENAME], {
          [Page.TEMPLATENAME]: {
              name: 'template_name',
              defaultValue: 'none'
          }
      
      })
      
      // Result:
      // page = {
      //     template_name: 'none',
      //     title: 'page title'
      // }

      Providing true for keepExtraFields parameter will keep the keys that are not part of the data object definition

      const page = new Page({
          [Page.TITLE]: 'page title',
          'pageStatus': 'login'
      }, [], {}, true)
      
      // Result:
      // page = {
      //     template_name: 'none',
      //     pageStatus: 'login'
      // }

      Data Object and available keys

      • Page (initialValues, additionalRequiredFields, keyMap, keepExtraFields = false)

        • PATH
        • LOCATION
        • TITLE
        • TEMPLATENAME
      • Product (initialValues, additionalRequiredFields, keyMap, keepExtraFields = false)

        • ID (Required)
        • NAME (Required)
        • CATEGORY
        • BRAND
        • VARIANT
        • LIST
        • POSITION
        • PRICE
        • QUANTITY
        • COUPON
        • STOCK
      • Transaction (transactionInitialValues, productsInitialValues, transactionAdditionalRequiredFields, productAdditionalRequiredFields, transactionKeyMap, productKeyMap, keepExtraFields = false)

        • ID (Required)
        • AFFILIATION
        • REVENUE
        • TAX
        • SHIPPING
        • LIST
        • STEP
        • OPTION
      • ShoppingList (initialValues, additionalRequiredFields, keyMap, keepExtraFields = false)

        • COUNT - total number of items (a product of 2 quantity is 2 items)
        • TYPE - the type of this shopping list (cart or wishlist)
        • SUBTOTAL - total without tax, shipping, or discount
      • UIInteraction (initialValues, additionalRequiredFields, keyMap, keepExtraFields = false)

        • SUBJECT
        • OBJECT
        • ACTION
        • NAME
        • CONTENT

      Pages Naming Convention #

      A standard naming convention for pages across projects will help streamline the analytics capture & filter process.

      Use these standard names for pages within the app’s router and for the page.TEMPLATENAME variable

      • About Us Page: about-us
      • Account Address Page: account-address
      • Accoutn Dashboard Page: account-dashboard
      • Account Info Page: account-info
      • Account Order Page: account-order-list
      • Account Preference Page: account-preferences
      • View Order Page: account-view-order
      • React Main App: app
      • Blog Page: blog
      • Contact Us Page: contact-us
      • Cart: cart
      • Checkout Confirmation Page: checkout-confirmation
      • checkout-footer
      • checkout-header
      • Checkout Payment Page: checkout-payment
      • Checkout Shipping Page: checkout-shipping
      • Frequently Asked Questions: faq
      • Page Footer: footer
      • Forgot Password: forgot-password
      • Page Header: header
      • Home Page: home
      • Login Page: login
      • native-connector
      • Offline Page: offline
      • Order Status Page: order-status
      • 404 Error Page: page-not-found
      • Privacy Policy: privacy-policy
      • Product Details Page: product-details
      • Product List Page: product-list
      • Return Policy: return-policy
      • Shipping Policy: shipping-policy
      • Size Guide: size-guide
      • Store Locator/Find a Store: store-locator
      • Wishlist: wishlist