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

# Tracks

> A track shows every path that visitors take from a start event to a goal event.

A track shows how visitors move from one event to another. You choose a start event and a goal
event. Grain reads the sessions in between and draws a graph of the paths that reached the goal
and the paths that stopped. Tracks live in the dashboard under **Tracks**.

## The parts of a track

| Part        | Holds                                                        | Example                 |
| ----------- | ------------------------------------------------------------ | ----------------------- |
| Start event | Where the journey begins                                     | `page_view:/signup`     |
| Goal event  | The outcome that you want                                    | `account_created`       |
| Filters     | Optional. Event properties, user properties, or a date range | `page` equals `/signup` |

When you save a track, Grain does this:

<Steps>
  <Step title="Rebuild the sessions">
    Grain groups events into sessions. A session ends after 30 minutes without an event.
  </Step>

  <Step title="Extract the paths">
    Grain takes every event sequence between the start event and the goal event. If a visitor
    triggers the start event several times, each occurrence starts a new journey.
  </Step>

  <Step title="Sort the paths">
    A conversion path reached the goal. A deadend path stopped before the goal.
  </Step>

  <Step title="Score the hub nodes">
    Grain scores each event on flow, degree, betweenness, stability, and goal proximity. The
    events with the highest scores are hub nodes. Read the table below.
  </Step>

  <Step title="Draw the graph">
    Grain orders the nodes topologically and lays them out with a force-directed layout.
  </Step>
</Steps>

## Create a track

<Steps>
  <Step title="Open Tracks">
    In the dashboard sidebar, click **Tracks**. Then click **Create Track** or press
    `Cmd/Ctrl + N`.
  </Step>

  <Step title="Choose the start event">
    Choose the event where the journey begins, for example `page_viewed`. Add event property
    filters if you want a narrower start, for example `page` equals `/signup`.
  </Step>

  <Step title="Choose the goal event">
    Choose the outcome, for example `account_created`.
  </Step>

  <Step title="Set the time window">
    Choose the last 7 days (the default), the last 30 days, or a custom range of at most 90
    days. Then save.
  </Step>
</Steps>

Start with broad events, for example `page_viewed` to `purchase_completed`. Add filters after
you have seen the full graph.

## What a track shows

| Item               | Shows                                                                     |
| ------------------ | ------------------------------------------------------------------------- |
| Conversion metrics | The number of starters, the number of converters, and the conversion rate |
| Graph              | Every path from the start event to the goal event                         |
| Top paths          | The routes that the most visitors took                                    |
| Abandonment points | The events where the most visitors stopped                                |
| Time to goal       | How long the journeys took, as percentiles                                |

### Time to goal

| Value  | Meaning                                      |
| ------ | -------------------------------------------- |
| Median | Half of the converters were faster than this |
| P25    | 25% of the converters were faster than this  |
| P75    | 75% of the converters were faster than this  |
| P95    | 95% of the converters were faster than this  |

Use these values to set timeout windows, to find slow steps, and to measure a change.

### Hub nodes

A hub node is an event where many journeys converge. A change to a hub node moves more
conversions than a change to any other node. Grain scores each event on five values:

| Score          | Measures                                                  |
| -------------- | --------------------------------------------------------- |
| Flow           | How many visitors pass through the event                  |
| Degree         | How many edges enter and leave the event                  |
| Betweenness    | How often the event lies on a path from start to goal     |
| Stability      | How consistent the outgoing traffic is                    |
| Goal proximity | How likely a visitor is to reach the goal from this event |

## Read the graph

| Element            | Meaning                                                                   |
| ------------------ | ------------------------------------------------------------------------- |
| Green circle       | The start event                                                           |
| Blue target        | The goal event                                                            |
| Highlighted node   | A hub node                                                                |
| Gray circle        | An intermediate event                                                     |
| Edge thickness     | The number of visitors who made this transition. Hover to read the count. |
| Green edge         | The transition led to the goal                                            |
| Red edge           | The transition led to abandonment                                         |
| Completed marker   | A transition on a path that reached the goal                              |
| In progress marker | A transition on a journey that has not ended                              |

You can narrow the graph:

* Show only conversion paths, or only deadend paths.
* Hide paths under a minimum number of visitors.
* Break the graph down by country, device, referrer, or a custom property such as plan tier.

To compare two periods, two variants of an A/B test, or two cohorts, create one track per case
with the same start and goal events and different filters.

## Page and section events

Grain gives each page and each tracked section its own node. A plain `page_view` node hides
which page the visitor saw. The normalized node names it.

| Event             | Node name                | Example                                 |
| ----------------- | ------------------------ | --------------------------------------- |
| Page view         | `page_view:<path>`       | `page_view:/home`, `page_view:/pricing` |
| Section view      | `section_view:<section>` | `section_view:hero`, `section_view:cta` |
| Every other event | Unchanged                | `button_clicked`, `purchase_completed`  |

A path that reads `page_view:/home`, `button_clicked`, `page_view:/pricing`,
`purchase_completed` tells you that visitors saw the homepage before the pricing page. You can
use the normalized names as the start or goal event, for example `section_view:pricing_table`
to `checkout_initiated`.

<Note>
  Grain removes `scroll:section_*` events from tracks. Use heatmaps to read scroll behavior.
  Read [Heatmaps](/features/heatmaps).
</Note>

### Logarithmic normalization

Grain applies a logarithm to the path counts of each visitor. Then one visitor with 1000 page
views does not hide 50 visitors with 10 page views each.

| Page visits of one visitor | Raw count | Contribution     |
| -------------------------- | --------- | ---------------- |
| 1                          | 1         | log(2) = 0.69    |
| 10                         | 10        | log(11) = 2.40   |
| 100                        | 100       | log(101) = 4.62  |
| 1000                       | 1000      | log(1001) = 6.91 |

## Common tracks

| Question                                 | Start event          | Goal event               |
| ---------------------------------------- | -------------------- | ------------------------ |
| Where do new users get stuck?            | `account_created`    | `first_action_completed` |
| Where do customers abandon the checkout? | `cart_viewed`        | `purchase_completed`     |
| What leads to habitual use of a feature? | `feature_discovered` | `feature_became_habit`   |
| Which content converts readers?          | `blog_post_viewed`   | `newsletter_subscribed`  |
| Does the help content help?              | `help_page_viewed`   | `issue_resolved`         |

## Read the conversion rate

| Conversion rate | Meaning                                 | What to do                                                                                        |
| --------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------- |
| More than 50%   | The journey works.                      | Read the successful paths for a pattern. Remove a step if you can.                                |
| 20% to 50%      | The journey has room to improve.        | Find the largest drop-off point. Test a change to that step. Remove steps that are not necessary. |
| Less than 20%   | The journey has a large friction point. | Read the deadend paths for the event where most visitors stop. Ask users why they stopped.        |

If visitors take a path that you did not expect, find out why. If the path works, make it
easier. If it does not work, guide visitors to a better path.

## Rules for tracks

1. Start with a high-level journey, for example landing page to sign-up to activation.
2. Create tracks for the journeys that matter to the business first.
3. Read your tracks every week, so you see a trend early.
4. Do not create a track with narrow filters. It holds too little data to read.
5. Do not ignore the deadend paths. They show where visitors stop.
6. If you want journeys across devices, identify your users. Without a user ID, Grain cannot
   connect the sessions of one person on two devices. Read
   [Identify users](/core/user-identification).

## Limits

| Limit                           | Value          | Where           |
| ------------------------------- | -------------- | --------------- |
| Default time window             | 7 days         | Track creation  |
| Longest time window             | 90 days        | Track creation  |
| Session inactivity window       | 30 minutes     | Session rebuild |
| Compute time of a complex track | 1 to 2 minutes | Track analysis  |

A track runs on demand, not in real time.

For a track with millions of events, Grain uses balanced sampling. The sample holds both
conversion paths and deadend paths, and it always holds the start event and the goal event. The
conversion metrics stay accurate.

## What tracks do not do

* A track does not update in real time. It runs when you open it.
* A track does not connect sessions across devices without a user ID.
* A track does not show scroll events. Heatmaps do.
