Why Google Analytics Doesn't Show My Referring Site

Here's a rare technical post for the blog. I've been having issues not seeing the traffic generated from IRLXD.com to EurekaRoom.com in Google Analytics GA4. I see a lot of traffic the "(direct)" bucket, and assume most of that is irlxd.com. But why is this happening?

After a lot of digging and googling, the issue appears to be that I have a "noreferrer" attribute on the link.

I found some solutions but they had limitations:

  1. They only would update new content I'd make going forward (not the old stuff), or
  2. They would only update posts, or
  3. They wouldn't work if you had the link set to open in a new tab, or
  4. Some combination of the above.

Ugh.

Here's what I ended up doing.

  1. Open the inspector and test that the link has norefferer.
  2. Install the "Code Snippets" plugin.
  3. Create a snippet of the code outlined here that will prevent future content from having noreferrer.
  4. To fix existing content, create this snippet of the code.
  5. To test, be sure to clear all caches and open a new private mode or incognito window.
  6. Open the inspector and test that the link has changed.

That's it!