Refer sites are not getting stored


I see the referral sites are not getting saved in the database also.

I have implement the code here but all referrals are showing as “Direct Traffic”

Can you let me know the problem and possible sollution

See second question Troubleshooting - Analytics Platform - Matomo