ehash — a hashed version of a user’s email address — as a user identifier to enable cross-device tracking and session stitching in GA4.
By hashing email addresses collected on-site and sending them as an event parameter (ehash) to GA4, you can help SegmentStream’s identity graph more accurately associate sessions and users across devices and channels.
To support this:
- All links in marketing emails should include the
ehashparameter in the URL. - All email addresses captured onsite (e.g., during checkout or signup) must be hashed client-side and sent to GA4 as event parameters.
ehash based cross-device tracking.
Add ehash to email links
When a user submits their email on your site:
- Generate a hash (e.g., using
SHA-256). - Store it in your backend.
- Include the hashed email as a query parameter in all email links:
When a user lands on your site with an
ehash parameter in the URL, SegmentStream automatically captures it — no additional Segment or GA4 configuration is needed for this step.Capture and hash emails from on-site forms
When a user submits an email (e.g., through a popup or signup form), send an event to GA4 along with the ehash event parameter by following these steps:- Hash the email when a user submits a form.
- Send a Segment
track()call including theehash.
Forwarding ehash to GA4 (Segment Destination settings)
The GA4 Destination in Segment forwards all event properties by default. So as long as your track() call includes the property below, GA4 will receive this as an event parameter:
Capture and hash email on checkout
When the purchase is completed and the customer email is available:- Hash the email.
- Include it in the Segment
Purchaseevent (or whatever your ecommerce library sends).
Example using Segment’s ecommerce spec:
ehash automatically.