Skip to content

Commit 7f2250d

Browse files
committed
- added referrer
1 parent 52bc2a7 commit 7f2250d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/BreinifyUser.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
instance.add('userAgent', navigator.userAgent);
107107
}
108108

109+
// set the referrer to a default value if there isn't one yet
110+
if (instance.read('referrer') === null) {
111+
instance.add('referrer', document.referrer);
112+
}
113+
109114
// try to set the location if there isn't one yet
110115
if (instance.read('location') === null && $.isFunction(onReady)) {
111116
instance.addGeoLocation(onReady);
@@ -207,7 +212,7 @@
207212
this._user[attribute] = value;
208213
},
209214

210-
reset: function(attribute) {
215+
reset: function (attribute) {
211216
if ($.isPlainObject(this._user)) {
212217
delete this._user[attribute];
213218
}

0 commit comments

Comments
 (0)