cookiesgoogle-analyticsattribution

How does Google Analytics know the source of traffic?


How does Google Analytics know where visitors were when they came to our website? I understand when the referral source is Google search or Google Ads, but how does it know a user clicked a link on LinkedIn or from WhatsApp?

Sessions by Source


Solution

  • Google Analytics can understand source like Linkedin.com from document.referrer but he can't know source like Whatsapp or Outlook desktop so it will be Direct traffic. You can append UTMs parameters to the querystring of the URL to force custom source/medium.