alex35mil / sourcebuster-js

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

Predefined Organics listed as "referral" and Cannot Define New Organics in sbjs.init() #33

Open deuks opened 4 years ago

deuks commented 4 years ago

In the documentation and in the code, it seems like a certain grouping of sites were defined as organic sources (bing, yahoo, aol, ask, etc.). Yet when I visit my site from any of these sites, their medium comes up as "referral" This does not occur for google (It seemed, from looking at the code, google and yandex are done differently, as they are not in the same organics array as the rest?)

I figured I could just override this bug by putting an organics block in my sbjs.init() as described in the configuration examples, but it does not work. In contrast, overriding by using a referrral block instead (and setting the medium as "organic" manually) DOES work.

If anyone has any troubleshooting suggestions, they'd be much appreciated.

deuks commented 4 years ago

I did some more testing and I think I might have an idea of what is going on. It seems that most browsers do not pass the full referring link to the additional cookies, just the domain. This means there is no "q" term (or p term when applicable) and because sourcebuster is looking for these terms, it doesn't view these types as organic. The only place I was able to get this to work properly was the pre-chromium edge browser with bing. This passed in the entire referring link, q term and all, which allowed the type to be properly marked as "organic."