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:
- They only would update new content I’d make going forward (not the old stuff), or
- They would only update posts, or
- They wouldn’t work if you had the link set to open in a new tab, or
- Some combination of the above.
Ugh.
Here’s what I ended up doing.
- Open the inspector and test that the link has norefferer.
- Install the “Code Snippets” plugin.
- Create a snippet of the code outlined here that will prevent future content from having.
- To fix existing content, create this snippet of the code.
- To test, be sure to clear all caches and open a new private mode or incognito window.
- Open the inspector and test that the link has changed.
That’s it!