mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 04:06:39 +00:00
Replaced Unknown by Direct for traffic comming from undetermined referrers
This commit is contained in:
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
#### Changed
|
||||
|
||||
* [#205](https://github.com/shlinkio/shlink-web-client/issues/205) Replaced `jest-each` package by jet's native `test.each` function.
|
||||
* [#209](https://github.com/shlinkio/shlink-web-client/issues/209) Replaced `Unknown` by `Direct` for visits from undetermined referrers.
|
||||
|
||||
#### Deprecated
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ const updateBrowsersStatsForVisit = (browsersStats, { userAgent }) => {
|
||||
|
||||
const updateReferrersStatsForVisit = (referrersStats, { referer }) => {
|
||||
const notHasDomain = isNil(referer) || isEmpty(referer);
|
||||
const domain = notHasDomain ? 'Unknown' : extractDomain(referer);
|
||||
const domain = notHasDomain ? 'Direct' : extractDomain(referer);
|
||||
|
||||
referrersStats[domain] = (referrersStats[domain] || 0) + 1;
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('VisitsParser', () => {
|
||||
const { referrers } = stats;
|
||||
|
||||
expect(referrers).toEqual({
|
||||
'Unknown': 2,
|
||||
'Direct': 2,
|
||||
'google.com': 2,
|
||||
'm.facebook.com': 1,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user