Skip to content
ceaksan
SUBSCRIBERS ONLY analytics

GA4 Source/Medium Debugging: Detecting the Real Source with First-Party Cookies

First-party cookie based source tagging implementation to detect the real origin of purchase events showing as (direct)/(none) in GA4. GTM Custom HTML tags, cookie structure, GA4 custom dimension setup, and debug tools.

Apr 18, 2026
TL;DR

GA4's attribution model can lose source information on purchase events due to payment redirects, Safari ITP, and in-app browsers. The first-party cookie solution in this article writes UTM/gclid/fbclid information to two cookies on the landing page (dnm_src and dnm_cid), then sends it to GA4 as an event-scope custom dimension at purchase. Without touching the GA4 attribution model, it lets you see the real source as a secondary dimension in reports.

Subscribers Only

The full article plus 21 more subscriber-only posts come with a subscription.

Feedback

Share your thoughts on the selected paragraphs. Email is required so I can reply.

Type