# HubSpot Integration Testing: Partner Dashboard Overview

**Last Updated:** 2026-02-12

This document explains how our HubSpot integration works from a partner's perspective and summarizes the integration testing we ran. It focuses on how lead data, qualification status, deals, and earnings (MRR) flow from HubSpot to the partner dashboard—designed to be clear and actionable for the sales team.

---

## Quick Reference: Test Run Summary

| What We Tested | Result |
|----------------|--------|
| 3 contacts created in HubSpot with affiliate attribution | ✅ Visible in Leads table |
| 3 deals created with different MRR and subscription statuses | ✅ Visible in Earnings, MRR calculated correctly |
| Lead statuses (Neu, Qualifiziert, Deal) | ✅ Mapped correctly, filters work |
| UTM/campaign data (Quelle, Medium, Kampagne) | ✅ Displayed in table and Lead-Quellen charts |
| MRR calculation (20% of €439 = €87,80) | ✅ Correct |
| Level calculation (3 deals in 90 days = Starter) | ✅ Correct |
| Sync process (manual + cron) | ✅ Data refreshes as expected |
| Leaderboard (rank + MRR) | ✅ Correct rank and MRR displayed |

---

## Overview: What the Integration Does

When a partner refers someone to Ordio:

1. **Leads** are automatically tracked when the referred user submits a form (demo booking, lead capture, etc.).
2. **Deals** are created by the sales team in HubSpot when leads convert to customers.
3. **Data syncs** from HubSpot to the partner dashboard hourly (or on demand via "Sync mit HubSpot" in Verwaltung).
4. Partners see their performance—leads, deals, MRR, level, and campaign breakdown—in real time based on the synced data.

---

## Test Data Summary

For integration testing, we created **3 test contacts** and **3 test deals** in HubSpot, all attributed to a single partner. The data was designed to cover different lead statuses, deal MRR values, subscription statuses, and UTM/campaign sources.

| Type | Count | Purpose |
|------|-------|---------|
| **Contacts** | 3 | Different lead statuses: Neu, Qualifiziert, Deal |
| **Deals** | 3 | Different MRR (€89, €150, €200); 2 Active, 1 Paused; all Closed Won |

---

## Test Objects: Exact Values

### Contacts (Leads)

| Name | Company | Status | Quelle | Medium | Kampagne |
|------|---------|-------|--------|--------|----------|
| Markus Weber | Gastro-Betrieb Weber GmbH | Neu | linkedin | social | partner-q1-2026 |
| Anna Schmidt | Hotel Sonnenhof GmbH | Qualifiziert | affiliate | newsletter | partner-newsletter-feb |
| Thomas Fischer | Bäckerei Fischer GmbH | Deal | partner | email | demo-kampagne |

*These values are stored in HubSpot as `source__c`, `utm_medium__c`, and `utm_campaign__c` (UTM parameters). They appear in the Leads table and in the Lead-Quellen section.*

### Deals

| Deal Name | Deal MRR | Subscription Status | Partner's Share (20%) |
|-----------|----------|---------------------|-----------------------|
| Gastro-Betrieb Weber – Ordio Schichtplanung | €89 | Aktiv | €17,80 |
| Hotel Sonnenhof – Ordio Zeiterfassung | €150 | Aktiv | €30,00 |
| Bäckerei Fischer – Ordio Starter | €200 | Pausiert | €40,00 |
| **Total** | **€439** | — | **€87,80** |

*Partner level was Starter (20% MRR share). Total MRR shown on dashboard: **€87,80**.*

---

## How Data Flows: HubSpot → Sync → Dashboard

```mermaid
flowchart TD
    subgraph HubSpot [HubSpot]
        A[Contacts with affiliate_partner_id]
        B[Deals with affiliate_partner_id, MRR, status]
    end

    subgraph Sync [Sync Process]
        C[Sync mit HubSpot - hourly or manual]
        C --> D[Fetch contacts & deals per partner]
        D --> E[Calculate MRR, level, lead counts]
        E --> F[Write to local cache]
    end

    subgraph Dashboard [Partner Dashboard]
        G[Dashboard KPIs]
        H[Leads Table]
        I[Earnings / MRR]
        J[Levels & Badges]
        K[Leaderboard]
    end

    A --> C
    B --> C
    F --> G
    F --> H
    F --> I
    F --> J
    F --> K
```

**Key point:** The dashboard reads from a **local cache**—it never calls HubSpot directly. All data comes from the sync process.

---

## Screenshot: Full Partner Dashboard

> **[📷 INSERT SCREENSHOT: Partner Dashboard – full overview]**
>
> **File:** `FireShot_Capture_750_-_Partner_Dashboard_-_Ordio_Loop_-__localhost_-f8a2cf05-153b-4acf-889a-a2ac8d3dbffb.png`
>
> This shows the central hub where partners track their performance. Every action they take to refer leads, and every interaction our sales team has with those leads in HubSpot, is reflected here.

---

## Dashboard Section: Key Performance Indicators (KPIs)

The top KPI cards summarize the most important metrics. These numbers are **directly synced and calculated** from HubSpot data.

| Metric | Test Value | What It Means | How It's Calculated |
|--------|------------|---------------|---------------------|
| **Gesamt Leads** | 3 | Total leads referred by this partner | Count of contacts in HubSpot with `affiliate_partner_id` = partner ID |
| **Qualifizierte Leads** | 1 | Leads qualified by sales (MQL stage) | Count of contacts with lifecycle stage = Marketing Qualified Lead |
| **Deals** | 3 | Closed Won deals contributing to MRR | Count of deals with Closed Won stage and valid MRR |
| **Monatliches MRR** | €87,80 | Partner's share of revenue from their deals | Sum of (Deal MRR × Partner MRR share %) for each deal |

```mermaid
flowchart LR
    A[Partner Shares Link] --> B[New Lead in HubSpot]
    B --> C[Gesamt Leads +1]
    B -- Sales Qualifies --> D[Qualifizierte Leads +1]
    D -- Sales Creates Deal --> E[Deals +1]
    E -- Deal Closed Won --> F[MRR Calculated]
```

---

## Screenshot: KPI Cards

> **[📷 INSERT SCREENSHOT: KPI cards – Gesamt Leads, Qualifizierte Leads, Deals, Monatliches MRR]**
>
> **File:** `FireShot_Capture_751_-_Meine_Leads_-_Ordio_Loop_-__localhost_-273d5a41-ff4b-458d-a21b-74946672c7af.png` (crop top section)

---

## Conversion Funnel

The Conversion-Funnel chart shows how leads progress through our sales pipeline:

| Stage | Test Count | How It Maps from HubSpot |
|-------|------------|---------------------------|
| **Leads** | 3 | All contacts with `affiliate_partner_id` |
| **Qualifiziert** | 1 | Contacts with MQL lifecycle stage |
| **In Verhandlung** | 1 | Contacts in opportunity stage (deal in progress) |
| **Gewonnen** | 1 | Contacts with customer lifecycle stage |

```mermaid
graph LR
    A[Leads 3] --> B[Qualifiziert 1]
    B --> C[In Verhandlung 1]
    C --> D[Gewonnen 1]
```

---

## Screenshot: Conversion Funnel, MRR Trend, MRR Status

> **[📷 INSERT SCREENSHOT: Conversion Funnel, MRR Trend, MRR Status charts]**
>
> **File:** `FireShot_Capture_752_-_Earnings_-_Ordio_Loop_-__localhost_-ca251b20-866c-484b-9c91-8f8de848c95f.png`

---

## Leads Page: Individual Leads & Lead-Quellen

### Leads Table

Each lead shows: Name, Company, E-Mail, Telefon, Status, **Quelle**, **Medium**, **Kampagne**, and Empfehlungsdatum.

| Lead | Status | Quelle | Medium | Kampagne |
|------|--------|--------|--------|----------|
| Markus Weber – Gastro-Betrieb Weber GmbH | Neu | linkedin | social | partner-q1-2026 |
| Anna Schmidt – Hotel Sonnenhof GmbH | Qualifiziert | affiliate | newsletter | partner-newsletter-feb |
| Thomas Fischer – Bäckerei Fischer GmbH | Deal | partner | email | demo-kampagne |

### Lead-Quellen Section

Below the table, the **Lead-Quellen** section aggregates leads by Quelle, Medium, and Kampagne—showing partners which channels and campaigns perform best.

| Quelle | Leads | Medium | Leads | Kampagne | Leads |
|--------|-------|--------|-------|----------|-------|
| linkedin | 1 | social | 1 | partner-q1-2026 | 1 |
| affiliate | 1 | newsletter | 1 | partner-newsletter-feb | 1 |
| partner | 1 | email | 1 | demo-kampagne | 1 |

---

## Screenshot: Meine Leads – Table & Lead-Quellen

> **[📷 INSERT SCREENSHOT: Full Meine Leads page with table and Lead-Quellen cards]**
>
> **File:** `FireShot_Capture_751_-_Meine_Leads_-_Ordio_Loop_-__localhost_-273d5a41-ff4b-458d-a21b-74946672c7af.png`

---

## Earnings Page: MRR Breakdown

| KPI | Test Value | How It's Calculated |
|-----|------------|---------------------|
| **Gesamt MRR** | €87,80 | Sum of partner share across all Closed Won deals |
| **Aktive MRR** | €47,80 | MRR from deals with subscription status = Active (€89 + €150 = €239 × 20% = €47,80) |
| **Aktive Deals** | 2 | Count of deals with status = Active |
| **MRR-Anteil** | 20% | Partner's commission rate (Starter level) |

### MRR Status Donut Chart

- **Aktiv** (green): MRR from active deals
- **Pausiert** (orange): MRR from paused deals
- **Storniert** (grey): MRR from cancelled deals

---

## Screenshot: Earnings Page

> **[📷 INSERT SCREENSHOT: Earnings – MRR cards, donut chart, deal table]**
>
> **File:** `FireShot_Capture_752_-_Earnings_-_Ordio_Loop_-__localhost_-ca251b20-866c-484b-9c91-8f8de848c95f.png`

---

## Levels & Badges

### Level Calculation

Partner level is based on **deals closed in the last 90 days** (rolling window):

| Level | Deals in 90 Days | MRR Share |
|-------|------------------|------------|
| Beginner | 0 | 20% (display only until first deal) |
| Starter | 1–5 | 20% |
| Partner | 6–10 | 25% |
| Pro | 11+ | 30% |

**Test result:** 3 deals in 90 days → **Starter** level (20% MRR share).

### Badges

Badges are unlocked when partners hit milestones (e.g. first lead, first deal, €100 MRR). These are computed from the synced data.

---

## Screenshot: Levels & Erfolge

> **[📷 INSERT SCREENSHOT: Levels page – level card, progress bar, badges]**
>
> **File:** `FireShot_Capture_753_-_Levels___Erfolge_-_Ordio_Loop_-__localhost_-abd4d258-a034-41ec-9f86-e8233c4b778d.png`

---

## Leaderboard: Partner Rankings by MRR

The **Leaderboard** shows how partners rank against each other by monthly recurring revenue (MRR). It motivates high performers and gives partners a clear view of their competitive standing.

| What Partners See | What It Reflects |
|-------------------|------------------|
| **Dein Rang** | Their own rank and MRR (e.g. "Dein Rang: #1 · €87,80") |
| **Top Partner (Monat)** | Top partners for the current month, sorted by MRR |

**How it's calculated:** The leaderboard aggregates MRR from the synced cache—the same deal data that powers the Earnings page. Rankings are sorted by total partner MRR (partner share of deal MRR). Partners are shown anonymously (e.g. "Partner #1") unless they're viewing their own rank.

**Test result:** With €87,80 MRR, the test partner appeared as #1 on the leaderboard.

---

## Screenshot: Leaderboard

> **[📷 INSERT SCREENSHOT: Leaderboard – Dein Rang, Top Partner (Februar 2026)]**
>
> **File:** `FireShot_Capture_755_-_Leaderboard_-_Ordio_Loop_-__localhost_-0f805594-3cce-4a1d-9f5f-109b174c7c31.png`

---

## Verwaltung (Admin): Partner Overview & Sync

The **Verwaltung** page shows all partners with their synced metrics:

| Column | Description |
|--------|-------------|
| NAME | Partner name |
| E-MAIL | Partner email |
| PARTNER-ID | Unique identifier (e.g. AP-20260129-AD2F73) |
| STATUS | Aktiv / Inaktiv |
| LEVEL | Starter, Partner, Pro (calculated or manual) |
| LEADS | Count of referred leads |
| DEALS | Count of Closed Won deals |
| MRR | Monthly recurring revenue (partner share) |

**"Sync mit HubSpot"** button: Triggers an immediate sync—pulls latest data from HubSpot and updates the cache. Useful after sales creates new deals or updates deal status.

---

## Screenshot: Verwaltung

> **[📷 INSERT SCREENSHOT: Verwaltung – Partner table, Sync button, Admins, Letzte Aktionen]**
>
> **File:** `FireShot_Capture_754_-_Verwaltung_-_Ordio_Loop_-__localhost_-5c7ee293-95d0-4b7e-a8c3-5e2493428624.png`

---

## Letzte Aktivitäten: Real-Time Activity Feed

The "Letzte Aktivitäten" (Recent Activities) section shows a live feed of what's happening with individual leads and deals:

| What Partners See | What It Reflects |
|-------------------|------------------|
| **Status/Event** | NEU (new lead), QUALIFIZIERT (qualified), DEAL (deal created/closed) |
| **Lead/Company Name** | e.g. Markus Weber – Gastro-Betrieb Weber GmbH |
| **Campaign/Source** | UTM values (e.g. partner-q1-2026, partner-newsletter-feb, demo-kampagne) |
| **Timestamp** | e.g. "vor 17 Std" |

This helps partners connect their marketing efforts to specific outcomes.

---

## Sync Process: How Often & How to Trigger

| Method | When |
|--------|------|
| **Cron (automatic)** | Hourly at minute 0 |
| **Manual** | "Sync mit HubSpot" button in Verwaltung |

**Important:** After creating or updating deals in HubSpot, partners won't see changes until the next sync runs. Use "Sync mit HubSpot" for immediate updates during testing or when sales needs quick visibility.

---

## Sales Team Takeaways

1. **Leads = automatic**: When a referred user submits a form, the contact gets `affiliate_partner_id` automatically.
2. **Deals = manual**: Sales must set `affiliate_partner_id`, `affiliate_mrr`, and `affiliate_subscription_status` on deals for MRR tracking.
3. **Sync timing**: Data appears on the dashboard after the next sync (hourly, or immediately if "Sync mit HubSpot" is clicked).
4. **UTM parameters**: Partners can add source, medium, and campaign to their links; these appear in the Leads table and Lead-Quellen section.

---

## Next Step: HubSpot Workflow for Deal Attribution

**Purpose:** Copy `affiliate_partner_id` from contact to deal when a deal is created or updated—so sales rarely needs to set it manually.

**Setup:**

1. HubSpot → **Settings** → **Automation** → **Workflows**
2. Create **Deal-based workflow**: "Copy Affiliate Attribution to Deal"
3. **Trigger:** Deal created (or Deal property value changes → Deal stage)
4. **Condition:** Associated contact has `Affiliate Partner ID` is known
5. **Actions:**
   - Set Deal `Affiliate Partner ID` = Contact `Affiliate Partner ID`
   - Set Deal `Affiliate Subscription Status` = Active

**Result:** Deals linked to affiliate contacts get partner ID and default status automatically. Sales still sets `Affiliate MRR` manually.
