Skip to main content

Posts

Showing posts with the label GA4 Measurement Protocol

Solving the '(not set)' Attribution Issue in GA4 Measurement Protocol

  You have successfully implemented server-side tracking using Node.js and the Google Analytics 4 (GA4) Measurement Protocol. Your events are arriving in the dashboard, and your revenue numbers match your backend database. However, when you check the  Traffic Acquisition  report, those server-side conversion events fall into the black hole of  (not set) ,  Unassigned , or  Direct . Your "Purchase" events are disconnected from the "Session Start" events that occurred in the browser. Consequently, you cannot attribute revenue to the Google Ads campaign, SEO landing page, or email newsletter that drove the sale. This guide provides the architectural root cause and a production-ready Node.js solution to stitch server-side events back to the original client-side session. The Root Cause: Missing Session Context To understand why attribution fails, you must understand how GA4 defines a "Session." When a user visits your site,  gtag.js  (the client-side l...