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

# Identity graph

> Connect fragmented user sessions across browsers, devices, and channels for accurate multi-touch attribution.

The SegmentStream Identity Graph is a core part of the attribution infrastructure. It connects fragmented user sessions across browsers, devices, and channels to enable more accurate multi-touch attribution (MTA) and a unified view of the customer journey.

By using a combination of identifiers collected on-site, the identity graph helps associate sessions with users across devices -- even when they don't log in -- improving attribution, optimisation, and decision-making.

## Why it matters

Modern users interact with brands across multiple channels and devices. A typical journey may include:

* Subscribing to a newsletter on mobile
* Clicking a retargeting ad on desktop
* Converting later on tablet

Without stitching these sessions together, each would be seen as a separate user, breaking attribution.

The identity graph enables SegmentStream to connect these interactions, reconstruct the full path to conversion, and attribute value accurately.

## What data is used to stitch sessions

SegmentStream combines the following identifiers to build and enrich the identity graph:

| Identifier           | Description                                                                                                                                                            |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `user_id`            | A persistent user identifier (e.g. when logged in) -- the strongest signal.                                                                                            |
| `ip_address`         | Used as a fallback when stronger IDs are missing; often combined with timestamp and location heuristics.                                                               |
| `click_id`           | Unique ad click identifiers (e.g. `gclid`, `fbclid`) used to match sessions to ad interactions.                                                                        |
| `email hash (ehash)` | A SHA-256 hashed version of the user's email collected on forms (e.g. newsletter signup, checkout). Enables matching to email campaigns and cross-device interactions. |

<Note>
  SegmentStream uses confidence-weighted merging logic to stitch sessions based on multiple identifiers.
</Note>

## Use cases

* **Cross-device attribution** -- Match a subscription on mobile to a purchase on desktop via `ehash`.
* **Campaign path stitching** -- Connect Meta, Google, and direct sessions leading to a conversion.
* **Better ML input** -- Feed complete user journeys into conversion modelling, improving performance.

## Best practices for implementation

To get the most from the identity graph, implement the following:

* **Send `user_id` to GA4** whenever a user logs in or authenticates.
* **Preserve `click_id` parameters** when redirecting from ad platforms by implementing the [SegmentStream SDK](/project-configuration/sdk).
* **Implement `ehash`** by capturing and hashing emails from forms (e.g. newsletter, checkout) and adding `ehash` to email links (e.g. `https://site.com?ehash=...`). SegmentStream automatically captures `ehash` from URLs -- you only need to ensure it's included in your email links and sent with on-site form events.

## In this section

<CardGroup cols={3}>
  <Card title="User ID" icon="user" href="/project-configuration/identity-graph/user-id">
    Implement user ID tracking in Google Analytics for cross-device attribution.
  </Card>

  <Card title="Email hash (Segment)" icon="envelope" href="/project-configuration/identity-graph/cross-device-tracking-via-email-hash-(segment)">
    Implement ehash-based cross-device tracking using Segment.
  </Card>

  <Card title="Email hash (GTM)" icon="tag" href="/project-configuration/identity-graph/cross-device-tracking-via-email-hash-(gtm)">
    Implement ehash-based cross-device tracking using Google Tag Manager.
  </Card>
</CardGroup>
