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

# Funnels

> Measure conversion through a series of steps

## Overview

Funnels measure how users progress through a sequence of events. Track conversion rates, identify drop-off points, and understand how long users take to complete multi-step processes.

In Cryptique, funnels are uniquely powerful because they can combine **off-chain events** (website behavior) with **on-chain transactions** (blockchain activity).

## Use Cases

<AccordionGroup>
  <Accordion title="Conversion Funnels">
    * What percent of users who view the swap page actually swap?
    * Where do users drop off in the onboarding flow?
    * How does mobile conversion compare to desktop?
  </Accordion>

  <Accordion title="Web3 Attribution">
    * What percent of wallet connections lead to transactions?
    * How long from first visit to first on-chain transaction?
    * Which traffic sources have the highest transaction conversion?
  </Accordion>

  <Accordion title="Feature Adoption">
    * How many users who try feature X go on to use feature Y?
    * What's the path from free to paid?
    * Do users who complete onboarding transact more?
  </Accordion>
</AccordionGroup>

## Quick Start

<Steps>
  <Step title="Define Funnel Steps">
    Add events in order. Each step must happen after the previous:

    ```
    Step 1: page_view (landing page)
    Step 2: wallet_connect
    Step 3: swap_initiated
    Step 4: Transaction: swapExactTokensForTokens
    ```
  </Step>

  <Step title="Set Conversion Window">
    Choose how long users have to complete the funnel:

    * 1 hour, 1 day, 7 days, 30 days, etc.
  </Step>

  <Step title="Choose Measurement">
    * **Conversion Rate**: Percentage completing all steps
    * **Unique Users**: Count at each step
    * **Time to Convert**: Average time between steps
  </Step>

  <Step title="Apply Filters">
    Filter to specific user segments or time periods
  </Step>

  <Step title="Add Breakdowns">
    See how conversion varies by property
  </Step>
</Steps>

## Funnel Structure

### Steps

Each funnel step is an event or transaction:

```mermaid theme={null}
flowchart LR
    S1[Step 1: page_view<br/>uri = /swap] --> S2[Step 2: wallet_connect]
    S2 --> S3[Step 3: swap_initiated<br/>input_token = ETH]
    S3 --> S4[Step 4: Transaction<br/>swapExactTokensForTokens<br/>Swap Router]
```

### Conversion Window

Users must complete all steps within the window:

```mermaid theme={null}
flowchart TB
    subgraph UserA["User A — Converted ✓"]
        A1[Day 1: page_view] --> A2[Day 3: wallet_connect] --> A3[Day 5: swap_initiated] --> A4[Day 6: Transaction]
    end
    subgraph UserB["User B — Not converted ✗"]
        B1[Day 1: page_view] --> B2[Day 2: wallet_connect]
        B2 -.->|Day 10: too late| B3[swap_initiated ✗]
    end
```

**Conversion Window: 7 days** — User A completed in 6 days; User B missed the window.

### Step Order

Steps must occur in the defined order:

```mermaid theme={null}
flowchart LR
    A[Step 1: A] --> B[Step 2: B] --> C[Step 3: C] --> OK[Converted ✓]
```

**Valid:** A → B → C

```mermaid theme={null}
flowchart LR
    A2[A] --> C2[C] --> B2[B]
    B3[B] --> A3[A] --> C3[C]
```

**Invalid:** A → C → B or B → A → C (order matters)

## Measurements

### Conversion Rate

Percentage of users who complete each step:

```mermaid theme={null}
flowchart LR
    S1[Step 1<br/>10,000 users<br/>100%] --> S2[Step 2<br/>3,500 users<br/>35%] --> S3[Step 3<br/>1,200 users<br/>12%] --> S4[Step 4<br/>800 users<br/>8%]
```

**Overall Conversion: 8%**

### Step-by-Step Rate

Conversion from each step to the next:

```
├── Step 1 → Step 2: 35% (3,500 / 10,000)
├── Step 2 → Step 3: 34% (1,200 / 3,500)
└── Step 3 → Step 4: 67% (800 / 1,200)
```

### Time to Convert

How long users take between steps:

```
Average time:
├── Step 1 → Step 2: 2.5 hours
├── Step 2 → Step 3: 15 minutes
├── Step 3 → Step 4: 5 minutes
└── Total: 2 hours 50 minutes
```

## Filters

Filter your funnel to specific segments:

### Global Filters

Apply to all steps:

```
Filter: country = "US" AND device_type = "mobile"

All steps will only include US mobile users
```

### Step-Specific Filters

Apply to individual steps:

```
Step 1: page_view
  └── where: uri = "/swap" (step filter)
  
Step 2: wallet_connect
  └── where: wallet_type = "metamask" (step filter)
```

### User Property Filters

Filter by user attributes:

```
Filter: Users where
├── plan = "pro"
├── AND wallet_age_days > 30
└── AND is_whale = false
```

## Breakdowns

See how conversion varies across segments:

### Property Breakdown

```
Funnel by utm_source:
├── twitter: 12% conversion
├── discord: 18% conversion
├── google: 8% conversion
└── direct: 15% conversion
```

### Cohort Breakdown

```
Funnel by user type:
├── Whales: 25% conversion
├── Active traders: 15% conversion
└── New users: 6% conversion
```

## Visualizations

### Funnel Steps View

See the funnel as a visual diagram:

```mermaid theme={null}
flowchart LR
    L[Landing Page<br/>10,000 · 100%] --> W[Wallet Connect<br/>3,500 · 35%]
    W --> S[Swap Init<br/>1,200 · 12%]
    S --> T[Transaction<br/>800 · 8%]
```

*65% drop → 23% drop → 4% drop between steps*

### Line Chart

See conversion trend over time:

```
Overall conversion rate by week:
├── Week 1: 7%
├── Week 2: 8%
├── Week 3: 9%
└── Week 4: 8%
```

### Bar Chart

Compare conversion across segments:

```
Conversion by chain:
├── Ethereum: 12%
├── Polygon: 15%
├── Arbitrum: 18%
└── Base: 14%
```

## Advanced Features

### Conversion Criteria

**Ordered Steps** (default):
Users must complete steps in exact order.

```
A → B → C required
A → C → B does not convert
```

**Any Order**:
Steps can happen in any sequence within window.

```
A, B, C required (any order)
A → C → B converts ✓
C → A → B converts ✓
```

### Counting Methods

**Unique Users** (default):
Each user counted once, on first entry:

```
User enters funnel multiple times:
├── Monday: Enters at Step 1
├── Tuesday: Enters at Step 1 again
└── → Only Monday entry counted
```

**Totals**:
Count all funnel entries:

```
User enters funnel multiple times:
├── Monday: Entry 1
├── Tuesday: Entry 2
└── → Both entries counted
```

### Time to Convert Distribution

See how conversion time varies:

```
Time to complete funnel:
├── < 1 hour: 45%
├── 1-4 hours: 25%
├── 4-24 hours: 15%
├── 1-3 days: 10%
└── > 3 days: 5%
```

### Hold Property Constant

Require a property to be the same across steps:

```
Hold constant: input_token

User swaps ETH in step 1, must swap ETH in transaction:
├── Step 1: swap_initiated (input_token = "ETH")
└── Step 4: Transaction with ETH → Counts ✓

├── Step 1: swap_initiated (input_token = "ETH")
└── Step 4: Transaction with MATIC → Does NOT count ✗
```

## Web3 Funnel Examples

### Website to On-Chain Conversion

Track the full journey from landing to blockchain:

```
Step 1: page_view (landing page)
Step 2: button_clicked (CTA)
Step 3: wallet_connect
Step 4: swap_initiated (button click)
Step 5: [Transaction] swap on DEX

Filter: utm_source = "twitter"
Window: 7 days
```

### Multi-Chain Attribution

Compare conversion by blockchain:

```
Step 1: wallet_connect
Step 2: chain_selected
Step 3: [Transaction] any transaction

Breakdown: chain
```

### NFT Mint Funnel

Track mint journey:

```
Step 1: collection_viewed
Step 2: wallet_connect
Step 3: mint_initiated
Step 4: [Transaction] mint function

Breakdown: traffic_source
```

### Feature to Transaction

Do feature users convert better?

```
Step 1: feature_used (advanced_charts)
Step 2: [Transaction] any transaction

Compare to:
Step 1: page_view (any page)
Step 2: [Transaction] any transaction
```

## Analyzing Results

### Identifying Drop-Off Points

Look for the biggest drops:

```
├── Step 1 → Step 2: 35% (65% drop) ← Biggest drop!
├── Step 2 → Step 3: 80% (20% drop)
└── Step 3 → Step 4: 90% (10% drop)

Focus on: Why aren't users connecting wallets?
```

### Comparing Segments

Find high-performing segments:

```
By device:
├── Desktop: 12% conversion
└── Mobile: 4% conversion ← Investigate mobile UX

By country:
├── US: 15% conversion
├── UK: 14% conversion
└── DE: 8% conversion ← Different market?
```

### Time Analysis

Understand conversion timing:

```
Users who convert in < 1 hour: 45%
→ Quick decision makers

Users who convert in > 24 hours: 15%
→ Need nurturing/reminders
```

## Best Practices

### Keep Funnels Focused

```
✅ Good: 4-6 steps focused on one journey
page_view → wallet_connect → swap_init → transaction

❌ Avoid: 15 steps covering everything
page_view → click → scroll → hover → click → modal → ...
```

### Choose Appropriate Windows

```
Quick actions (checkout): 1 hour - 1 day
Considered decisions (signup): 1-7 days
Long cycles (enterprise): 7-30 days
```

### Use Consistent Filters

When comparing funnels, use the same base filters:

```
✅ Compare: 
- Twitter traffic funnel (filter: utm_source = twitter)
- Discord traffic funnel (filter: utm_source = discord)

❌ Misleading:
- All traffic funnel
- Mobile-only funnel (different population)
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Retention" icon="calendar-check" href="/analysis/reports/retention">
    Measure user engagement over time
  </Card>

  <Card title="Cohorts" icon="users" href="/analysis/cohorts">
    Create user segments
  </Card>
</CardGroup>
