alex35mil / sourcebuster-js

Track the sources of your traffic
https://alexfedoseev.github.io/sbjs
MIT License
413 stars 93 forks source link

New referral or typein sessions aren't saved if current cookie is set to "cpc" or "organic" #15

Open m4xbl4ck opened 7 years ago

m4xbl4ck commented 7 years ago

Title says it all.

Here's two examples,

I love the script, it's SUPER useful, I just wish that the 2 issues I just reported were fixed so my data stay accurate :) congrats for the good job!

infused-kim commented 6 years ago

Isn't this intended behaviour as described in the README:

The rules are the same with Google Analytics:

  • UTM and Organic source always overrides any previous source.
  • Typein never overrides a previous source.
  • Referral source overrides previous source only if there is no user session at the moment. If it’s inside the same session — a referral source will never override previous source.

Explanation to referral logic: sometimes visitor within the current visit (session) comes to the website from the “source” which is not actually a “source”. For example, it can be visit from the email service, where he had a registration activation link.

If all the sessions you described happened within the session duration (30min by default), then this should be correct. If the sessions you described were outside of 30min, then its a bug.