> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vizkraft.com/llms.txt
> Use this file to discover all available pages before exploring further.

# E-commerce / D2C retail

> Connect retail data, build five dashboards, and ask revenue, marketing, and support questions — modeled on a D2C brand like ShopNova.

export const CookbookDemoVideo = ({slug, caption = "See this cookbook in Vizkraft"}) => {
  const base = `/public/recordings/cookbooks/${slug}`;
  return <figure className="not-prose my-8 overflow-hidden rounded-xl border border-gray-200 dark:border-gray-800">
      {caption ? <figcaption className="border-b border-gray-200 bg-gray-50 px-4 py-2 text-center text-sm text-gray-600 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-400">
          {caption}
        </figcaption> : null}
      <video autoPlay muted loop playsInline className="w-full dark:hidden">
        <source src={`${base}/mist.webm`} type="video/webm" />
        <source src={`${base}/mist.mp4`} type="video/mp4" />
      </video>
      <video autoPlay muted loop playsInline className="hidden w-full dark:block">
        <source src={`${base}/carbon.webm`} type="video/webm" />
        <source src={`${base}/carbon.mp4`} type="video/mp4" />
      </video>
    </figure>;
};

This cookbook is for **direct-to-consumer retail** teams — brands selling online with orders, campaigns, web traffic, inventory, and support tickets. The examples use **ShopNova**, a fictional D2C apparel and electronics company.

## Who this is for

|                  |                                                           |
| ---------------- | --------------------------------------------------------- |
| **Company type** | D2C e-commerce, online retail, consumer brands            |
| **Connector**    | PostgreSQL or MongoDB                                     |
| **Teams**        | Leadership, marketing, growth, support, inventory and ops |

## Get started

<Steps>
  <Step title="Add your connector">
    Add a PostgreSQL or MongoDB connector in `Connectors`. See [Add connectors](/guides/add-connectors).
  </Step>

  <Step title="Index your schema">
    Run indexing and mark the important tables listed below. See [Index your data](/guides/index-your-data).
  </Step>

  <Step title="Ask your first question">
    Try: *What is total revenue year to date by region?*
  </Step>

  <Step title="Build the dashboards below">
    Save charts from chat, add them to dashboards, and apply filters or saved views. See [Filters, views, and exports](/guides/filters-views-and-exports).
  </Step>
</Steps>

## See it in Vizkraft

<CookbookDemoVideo slug="ecommerce-retail" caption="ShopNova dashboards and chat in Vizkraft" />

## Your data

Retail analytics usually spans product catalog, customers, marketing, orders, site behavior, inventory, and support. Your schema may differ, but these are the objects this cookbook assumes.

<Tabs>
  <Tab title="PostgreSQL">
    Typical tables:

    | Table                 | What it holds                                     |
    | --------------------- | ------------------------------------------------- |
    | `products`            | SKU, category, brand, pricing                     |
    | `customers`           | Segment, region, loyalty tier, lifetime value     |
    | `campaigns`           | Channel, budget, spend, target segment            |
    | `orders`              | Order header — date, status, channel, campaign    |
    | `order_items`         | Line-level revenue and quantity                   |
    | `web_events`          | Page views, add-to-cart, checkout steps, UTM data |
    | `inventory_movements` | Stock in/out by warehouse                         |
    | `support_tickets`     | Priority, issue type, CSAT, resolution            |
  </Tab>

  <Tab title="MongoDB">
    Typical collections:

    | Collection            | What it holds                                 |
    | --------------------- | --------------------------------------------- |
    | `products`            | SKU, category, brand, pricing                 |
    | `customers`           | Segment, region, loyalty tier, lifetime value |
    | `campaigns`           | Channel, budget, spend, target segment        |
    | `orders`              | Orders with nested line items and totals      |
    | `web_events`          | Funnel events, sessions, UTM attribution      |
    | `inventory_movements` | Stock in/out by warehouse                     |
    | `support_tickets`     | Priority, issue type, CSAT, resolution        |
  </Tab>
</Tabs>

### Tables to mark during indexing

* **Orders** — revenue, conversion, and channel performance
* **Campaigns** — marketing attribution and ROAS
* **Web events** — funnel and traffic analysis
* **Customers** — segment and region breakdowns
* **Support tickets** — CX volume and satisfaction
* **Inventory movements** — fulfillment and stock health

## Dashboards to build

### Executive overview

**Answers:** How is the business performing overall?

Include revenue and order KPIs, a monthly revenue trend, breakdowns by region and category, a purchase funnel, and a summary table. Apply a **last 90 days** filter.

### Campaign performance

**Answers:** Which campaigns drive leads and return on spend?

Include spend, ROAS, leads, and conversion KPIs; a bar chart by campaign; daily spend over time; and a campaign detail table. Save **views per campaign** so stakeholders can open the same dashboard filtered to their program.

### Marketing funnel

**Answers:** Where do shoppers drop off?

Include a view → cart → checkout → purchase funnel, daily active users, and channel mix. Try an AI filter such as *Last 90 days only*.

### Support and CX

**Answers:** How healthy is customer support?

Include open tickets, CSAT, and average resolution KPIs; volume by issue type and agent team; and a ticket table filtered by priority and status.

### Inventory and fulfillment

**Answers:** Are we stocking the right products in the right places?

Include stockout and turnover KPIs, warehouse movement bars, a movement trend line, and a low-stock table. Filter by category and warehouse.

## Questions to ask by role

| Role              | Questions to try                                                                          |
| ----------------- | ----------------------------------------------------------------------------------------- |
| CEO / GM          | What is total revenue YTD? Which region drives the most revenue? What is conversion rate? |
| Marketing manager | Compare leads, spend, and conversion rate by campaign. Which channel has the best ROAS?   |
| Growth analyst    | Show daily add-to-cart rate for the last 30 days. Which segment converts best?            |
| Support lead      | Break down support volume by priority and assignee. What is average CSAT by issue type?   |
| Ops / inventory   | Which warehouses have the most sale movements? Show return rate by category.              |

## Example conversations

### Monthly revenue trend

**Ask:** What was month-on-month revenue across the last three quarters?

Vizkraft usually returns a line chart of monthly revenue with notes on which quarters accelerated or slowed.

**Try next:** Which region grew fastest?

A strong follow-up compares growth **rate** in smaller regions with **absolute** revenue in larger ones.

### Campaign comparison

**Ask:** Compare leads, spend, and conversion rate by campaign.

Look for a grouped bar or composed chart with spend and conversion on the same view.

**Try next:** Focus on the enterprise customer segment only — then save the result as a dashboard view for your next business review.

## Metrics worth defining

If your team uses specific definitions, add them to [Connector memory](/features/connector-memory) so everyone gets consistent answers:

* **ROAS** — campaign-attributed revenue divided by spend
* **Conversion rate** — purchases divided by sessions (or orders divided by add-to-cart events)
* **Lifetime value** — total revenue per customer over the relationship
