Spec: Local Events

Event Lifecycle Overview

Browsing

ActionDescription
Products SearchedUser searched for products

Core Ordering

ActionDescription
Product ViewedUser viewed a product details
Checkout StartedUser initiated the order process (a transaction is created)
Payment Info EnteredUser added payment information
Order CompletedUser completed the order

Browsing

Products Searched

Fire this event when a visitor searches for products.

analytics.track('Products Searched', {
  query: 'Hells Kitchen',
  location: 'Sedona, AZ, United States',
  date: '6/18/2016 4pm',
  quantity: 3
  coupon: 'MIT2013'
});
PropertyTypeDescription
queryStringQuery the user searched with
locationStringDesired location
dateDateDesired date
quantityNumberNumber of guests/event tickets
bookingWindowDateDays between todays date and checkin date
couponStringCoupon searched with

Core Ordering

Product Viewed

Fire this event when a visitor views a product. That view might happen on a page, screen, or preview modal.

analytics.track('Product Viewed', {
  product_id: '507f1f77bcf86cd799439011',
  category: 'Restaurants',
  name: 'Hells Kitchen',
  location: 'Sedona, AZ, United States',
  date: '6/18/2016 4pm',
  quantity: 3,
  currency: 'usd',
  value: 34.33
});
PropertyTypeDescription
product_idStringDatabase id of the product being viewed
categoryStringProduct category being viewed
nameStringName of the product being viewed
locationStringDesired location
dateDateDesired date
quantityNumberNumber of guests/event tickets
currencyStringCurrency represented
valueNumberTotal value

Note: The Product Viewed event is aliased to the Viewed Product event from e-commerce v1 spec.

Checkout Started

Fire this event whenever an order/transaction was started. Fire on the page that the customer lands on after they press the checkout button.


analytics.track('Checkout Started', {
  product_id: '507f1f77bcf86cd799439011',
  category: 'Restaurants',
  name: 'Hells Kitchen',
  location: 'Sedona, AZ, United States',
  date: '6/18/2016 4pm',
  quantity: 3,
  currency: 'usd',
  value: 34.33
});
PropertyTypeDescription
product_idStringDatabase id of the product being viewed
categoryStringProduct category being viewed
nameStringName of the product being viewed
locationStringDesired location
dateDateDesired date
quantityNumberNumber of guests/event tickets
currencyStringCurrency represented
valueNumberTotal value

Note: The Checkout Started event is aliased to the Started Order event from Segment’s GA Enhanced E-Commerce Integrations.

Payment Info Entered

Fire this event whenever a checkout step is completed.

analytics.track('Payment Info Entered', {
      checkout_id: '39f39fj39f3jf93fj9fj39fj3f',
      order_id: 'dkfsjidfjsdifsdfksdjfkdsfjsdfkdsf'
    });
PropertyTypeDescription
checkout_idStringCheckout transaction ID
order_idStringOrder ID (optional)

Note: You can have as many or as few steps in the checkout funnel as you’d like. Note that you’ll still need to track the Order Completed event per our standard e-commerce tracking API after you’ve tracked the checkout steps.

Note: The Payment Info Entered event is aliased to the Completed Checkout Step event from Segment’s GA Enhanced E-Commerce Integration.

Order Completed

Fire this event whenever an order/transaction was successfully completed by the customer.

analytics.track('Order Completed', {
  checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
  order_id: '50314b8e9bcf000000000000',
  product_id: '507f1f77bcf86cd799439011',
  category: 'Restaurants',
  name: 'Hells Kitchen',
  location: 'Sedona, AZ, United States',
  date: '6/18/2016 4pm',
  quantity: 3,
  currency: 'usd',
  value: 34.33
});
PropertyTypeDescription
product_idStringDatabase id of the product being viewed
categoryStringProduct category being viewed
nameStringName of the product being viewed
locationStringDestination
dateDateDesired date
quantityNumberNumber of guests/event tickets
currencyStringCurrency represented
valueNumberTotal value

Note: The Order Completed event is aliased to the Completed Order event from E-Commerce spec v1.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!