# Lead Source Mismatches - Comparison Table


**Last Updated:** 2025-11-20

**Total Contacts with Mismatches:** 90

| Pattern                          | Count | HubSpot Actual | Simulated      | source\_\_c        | utm_source\_\_c | utm_medium\_\_c | utm_campaign\_\_c | gclid\_\_c | Example Email                    |
| -------------------------------- | ----- | -------------- | -------------- | ------------------ | --------------- | --------------- | ----------------- | ---------- | -------------------------------- |
| -> direct traffic                | 77    | (empty)        | Direct Traffic | (empty)            | (empty)         | (empty)         | (empty)           | (empty)    | verena.dambach@solymar-therme.de |
| google -> organic search         | 4     | Google         | Organic Search | adwords            | (empty)         | ppc             | DE_Search_B_Brand | (empty)    | lottatara@gmx.de                 |
| direct traffic -> referral       | 4     | Direct Traffic | referral       | (empty)            | (empty)         | (empty)         | (empty)           | (empty)    | info@moctezuma-mainz.de          |
| direct traffic -> organic search | 3     | Direct Traffic | Organic Search | (empty)            | (empty)         | (empty)         | (empty)           | (empty)    | lola-d@gmx.de                    |
| referral -> organic search       | 2     | referral       | Organic Search | accounts.ordio.com | (empty)         | referral        | (empty)           | (empty)    | mahya19@icloud.com               |

## Detailed Examples by Pattern

### -> direct traffic (77 contacts)

**Example 1:** verena.dambach@solymar-therme.de

- **HubSpot Actual Lead Source:** `(empty)`
- **Simulated Lead Source:** `Direct Traffic`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 2:** florian.eisenbart@gmx.de

- **HubSpot Actual Lead Source:** `(empty)`
- **Simulated Lead Source:** `Direct Traffic`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 3:** patrick.vanoostveen@golfplatzborghees.com

- **HubSpot Actual Lead Source:** `(empty)`
- **Simulated Lead Source:** `Direct Traffic`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 4:** mayadecamotan@gmail.com

- **HubSpot Actual Lead Source:** `(empty)`
- **Simulated Lead Source:** `Direct Traffic`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 5:** malak.mustapha79@icloud.com

- **HubSpot Actual Lead Source:** `(empty)`
- **Simulated Lead Source:** `Direct Traffic`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

---

### google -> organic search (4 contacts)

**Status:** ✅ **FIXED**

**Issue:** Contacts with `source__c="adwords"` + `utm_medium__c="ppc"` were detected as "Organic Search" instead of "Paid Search"

**Root Cause:** `determineLeadSourceFromContext()` was checking referrer domain FIRST (before UTM parameters). When referrer was `https://www.google.com/` but no `gclid` was passed to the function, it returned "Organic Search" immediately without checking UTM parameters that indicate paid traffic (`utm_source="adwords"` + `utm_medium="ppc"`).

**Fix Applied:** UTM parameter check now happens BEFORE referrer check. When `utm_source="adwords"` + `utm_medium="ppc"/"cpc"/"paid"`, the function returns "Google" (Paid Search) regardless of referrer.

**Test Results:**

- ✅ Google referrer + adwords source + ppc medium (no gclid) → Returns "Google" ✅
- ✅ Google referrer + adwords source + ppc medium (with gclid) → Returns "Google" ✅
- ✅ Empty referrer + adwords source + ppc medium (no gclid) → Returns "Google" ✅

**Example 1:** lottatara@gmx.de

- **HubSpot Actual Lead Source:** `Google`
- **Simulated Lead Source (Before Fix):** `Organic Search` ❌
- **Simulated Lead Source (After Fix):** `Google` ✅
- **source\_\_c:** `adwords`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `ppc`
- **utm_campaign\_\_c:** `DE_Search_B_Brand`
- **gclid\_\_c:** `(empty)`
- **First URL:** `https://www.ordio.com/v3/?hsa_acc=...&gad_source=1&gad_campaignid=...`
- **First Referrer:** `https://www.google.com/`
- **Simulated UTM Source:** `adwords` (from source\_\_c)
- **Simulated UTM Medium:** `ppc`

**Example 2:** irmakkislaa@hotmail.com

- **HubSpot Actual Lead Source:** `Google`
- **Simulated Lead Source:** `Organic Search`
- **source\_\_c:** `adwords`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `ppc`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `adwords`
- **Simulated UTM Medium:** `ppc`

**Example 3:** lead-lc17624250997332@temp.ordio.com

- **HubSpot Actual Lead Source:** `Google`
- **Simulated Lead Source:** `Organic Search`
- **source\_\_c:** `adwords`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `ppc`
- **utm_campaign\_\_c:** `DE_Search_B_Brand`
- **gclid\_\_c:** `Cj0KCQiAq7HIBhDoARIsAOATDxB2T-vsOD07-99F5coZDpqNnfO8P3wL7GI0oY0yY-qTgXZLlyPgeAkaAjIcEALw_wcB`
- **Simulated UTM Source:** `adwords`
- **Simulated UTM Medium:** `ppc`

**Example 4:** lead-lc17630381218562@temp.ordio.com

- **HubSpot Actual Lead Source:** `Google`
- **Simulated Lead Source:** `Organic Search`
- **source\_\_c:** `adwords`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `ppc`
- **utm_campaign\_\_c:** `DE_Search_B_Brand`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `adwords`
- **Simulated UTM Medium:** `ppc`

---

### direct traffic -> referral (4 contacts)

**Status:** ✅ **EXPECTED IMPROVEMENT** - Simulation is more accurate than HubSpot

**Root Cause:** All contacts in this pattern have referrer from `watch.getcontrast.io` (external domain), which indicates referral traffic. HubSpot marked these as "Direct Traffic" but simulation correctly identifies them as referral traffic.

**Analysis:** These contacts came from a webinar registration page (`watch.getcontrast.io/videos/ordio-ordio-expert-talk/signup`) with referrer from the registration page (`watch.getcontrast.io/register/ordio-ordio-expert-talk`). This is clearly referral traffic, not direct traffic.

**Example 1:** info@moctezuma-mainz.de

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `referral` ✅ **CORRECT**
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **First URL:** `https://watch.getcontrast.io/videos/ordio-ordio-expert-talk/signup`
- **First Referrer:** `https://watch.getcontrast.io/register/ordio-ordio-expert-talk`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 2:** 4kleinfamilie@gmail.com

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `referral`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 3:** sascha@odessabar.de

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `referral`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 4:** eggers@schloss-hotel.de

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `referral`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

---

### direct traffic -> organic search (3 contacts)

**Status:** ✅ **EXPECTED IMPROVEMENT** - Simulation is more accurate than HubSpot

**Root Cause:** All contacts in this pattern have page paths that indicate organic search traffic (`/tools/`, `/insights/ratgeber/`, `/login` from workspace.ordio.com). Page path heuristics correctly detect these as organic search.

**Analysis:** These contacts accessed content-driven pages (tools, insights) which are typically found via search engines. HubSpot marked these as "Direct Traffic" but simulation correctly identifies them as organic search based on page path heuristics.

**Example 1:** lola-d@gmx.de

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `Organic Search` ✅ **CORRECT**
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **First URL:** `https://www.ordio.com/tools/tvoed-sue-gehaltsrechner`
- **Page Path:** `/tools/tvoed-sue-gehaltsrechner`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 2:** tarikkarabacak@web.de

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `Organic Search`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

**Example 3:** reineke@mc2-institute.com

- **HubSpot Actual Lead Source:** `Direct Traffic`
- **Simulated Lead Source:** `Organic Search`
- **source\_\_c:** `(empty)`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `(empty)`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `(empty)`
- **Simulated UTM Medium:** `(empty)`

---

### referral -> organic search (2 contacts)

**Status:** ✅ **FIXED**

**Issue:** Contacts with `source__c="accounts.ordio.com"` and `source__c="gmail.com"` were detected as "Organic Search" instead of "Direct Traffic" (for internal domains) or "referral" (for external domains).

**Root Cause:** Internal domains (like `accounts.ordio.com`) should be treated as Direct Traffic, not referral. The function was not checking if `utm_source` contained an internal domain before processing.

**Fix Applied:** Added internal domain detection for `utm_source` parameter. When `utm_source` contains an internal domain (e.g., "accounts.ordio.com", "workspace.ordio.com"), the function returns "Direct Traffic" instead of "referral". Also updated `isInternalDomain()` to include `accounts.ordio.com` and `workspace.ordio.com`.

**Test Results:**

- ✅ accounts.ordio.com source + referral medium → Returns "Direct Traffic" ✅
- ✅ gmail.com source + referral medium → Returns "referral" ✅

**Example 1:** mahya19@icloud.com

- **HubSpot Actual Lead Source:** `referral`
- **Simulated Lead Source (Before Fix):** `Organic Search` ❌
- **Simulated Lead Source (After Fix):** `Direct Traffic` ✅ (internal domain)
- **source\_\_c:** `accounts.ordio.com`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `referral`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `accounts.ordio.com`
- **Simulated UTM Medium:** `referral`

**Example 2:** lead-lc17628929105825@temp.ordio.com

- **HubSpot Actual Lead Source:** `referral`
- **Simulated Lead Source (Before Fix):** `Organic Search` ❌
- **Simulated Lead Source (After Fix):** `referral` ✅ (external domain)
- **source\_\_c:** `gmail.com`
- **utm_source\_\_c:** `(empty)`
- **utm_medium\_\_c:** `referral`
- **utm_campaign\_\_c:** `(empty)`
- **gclid\_\_c:** `(empty)`
- **Simulated UTM Source:** `gmail.com`
- **Simulated UTM Medium:** `referral`

---
