Giter Club home page Giter Club logo

ecommerce-analytics-guide's Introduction

E-Commerce Tracking Guide

This guide will walk you through some best practices for using Keen IO to track common e-commerce metrics such as:

  • Sign Up Rate
  • Activation Rate / Conversion Rate
  • Add to Cart Rate
  • Average Order Value
  • Repeat Purchase Rate
  • Lifetime Value

Data Model

In order to be able to do the queries for the metrics, we'll have to have the right data collections in place. Below, you'll find an example data model to use for your shop.

Collections

We'll be using the following collections that will help us

Collection: first_visits

Purpose: To track the first visit of each visitor. Attributes:

  • path: Path of the page.
  • referrer: Referrer URL, taken from document.referrer.
  • params: Desired URL params.
  • user: Information about the user, explained here.

Example event:

var client = new Keen({
    projectId: "your_project_id",
    writeKey: "your_write_key"
});

client.addEvent('first_visits', {
    path: "/ad-landing-page",
    referrer: "http://google.com",
    params: {
        utm_source: "google",
        utm_medium: "cpc",
        utm_campaign: "campaign_name"
    },
    "user": {
        uuid: "xxxx-xxxx-xxxx-xxxx-xxxx",
        first_visited_at: "2015-06-29T07:36:55.929Z"
    }
});

Collection: product_views

Purpose: To track product page views. Attributes:

  • path: Path of the page.
  • product_id: Product's ID.
  • product_name: Product's Name.
  • product_price: Product's Price.
  • user: Information about the user, explained here.

Example event:

var client = new Keen({
    projectId: "your_project_id",
    writeKey: "your_write_key"
});

client.addEvent('product_views', {
    "path": "/products/1800-summer-pants",
    "product_id": "1800"",
    "product_name": "Summer Pants",
    "product_price": 69.99,
    "user": {
        uuid: "xxxx-xxxx-xxxx-xxxx-xxxx",
        first_visited_at: "2015-06-29T07:36:55.929Z"
    }
});

Collection: add_to_carts

Purpose: To track a user adding a product to their Cart. Attributes:

  • cart_id: Cart'd ID.
  • product_id: Product's ID.
  • product_name: Product's Name.
  • product_price: Product's Price.
  • quantity: Quantity being added to Cart.
  • user: Information about the user, explained here.

Example event:

var client = new Keen({
    projectId: "your_project_id",
    writeKey: "your_write_key"
});

client.addEvent('add_to_carts', {
    "cart_id": "201",
    "product_id": "1800",
    "product_name": "Summer Pants",
    "product_price": 69.99,
    "quantity": 1,
    "user": {
        uuid: "xxxx-xxxx-xxxx-xxxx-xxxx",
        first_visited_at: "2015-06-29T07:36:55.929Z"
    }
});

Collection: purchases

Purpose: To track a succesful purchase. Attributes:

  • cart_id: Cart being purchased's ID.
  • total: Total amount being purchased.
  • user: Information about the user, explained here.

Example event:

var client = new Keen({
    projectId: "your_project_id",
    writeKey: "your_write_key"
});

client.addEvent('purchases', {
    "cart_id": "201",
    "total": 139.98,
    "user": {
        uuid: "xxxx-xxxx-xxxx-xxxx-xxxx",
        first_visited_at: "2015-06-29T07:36:55.929Z"
    }
});

Common attributes

In order to connect the different collections, we will be sending a user object attributes with all our events:

  • user.uuid: An identifier generated for the user when they first visited.
  • user.first_visited_at: A date for when the user first visited.

The common user attribute will help us to follow the user's journey through their experience on the site over time.

Tracking & Visualization

Tracking

To illustrate how to use the data model, we've created a fake example e-commerce website here with detailed examples of how and when to send events during the user's experience with your shop.

Visualization

Based on this data model and the events that are sent on the shop, we've setup an example dashboard here. You can also view the source for this dashboard in dashboard.js and dashboard.html.

ecommerce-analytics-guide's People

Contributors

aroc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.