|
196 | 196 | statusCode: "cly_hc_status_code",
|
197 | 197 | errorMessage: "cly_hc_error_message"
|
198 | 198 | });
|
199 |
| - var SDK_VERSION = "23.12.2"; |
| 199 | + var SDK_VERSION = "23.12.3"; |
200 | 200 | var SDK_NAME = "javascript_native_web";
|
201 | 201 |
|
202 | 202 | // Using this on document.referrer would return an array with 15 elements in it. The 12th element (array[11]) would be the path we are looking for. Others would be things like password and such (use https://regex101.com/ to check more)
|
|
831 | 831 | this.getSearchQuery = getConfig("getSearchQuery", ob, Countly.getSearchQuery);
|
832 | 832 | this.DeviceIdType = Countly.DeviceIdType; // it is Countly device Id type Enums for clients to use
|
833 | 833 | this.namespace = getConfig("namespace", ob, "");
|
834 |
| - this.clearStoredId = !isBrowser ? undefined : getConfig("clear_stored_id", ob, false); |
| 834 | + this.clearStoredId = getConfig("clear_stored_id", ob, false); |
835 | 835 | this.app_key = getConfig("app_key", ob, null);
|
836 | 836 | this.onload = getConfig("onload", ob, []);
|
837 | 837 | this.utm = getConfig("utm", ob, {
|
|
854 | 854 | this.country_code = getConfig("country_code", ob, null);
|
855 | 855 | this.city = getConfig("city", ob, null);
|
856 | 856 | this.ip_address = getConfig("ip_address", ob, null);
|
857 |
| - this.ignore_bots = !isBrowser ? undefined : getConfig("ignore_bots", ob, true); |
| 857 | + this.ignore_bots = getConfig("ignore_bots", ob, true); |
858 | 858 | this.force_post = getConfig("force_post", ob, false);
|
859 | 859 | this.remote_config = getConfig("remote_config", ob, false);
|
860 | 860 | this.ignore_visitor = getConfig("ignore_visitor", ob, false);
|
|
918 | 918 | }
|
919 | 919 | // then clear the storage so that a new device ID is set again later
|
920 | 920 | log(logLevelEnums.INFO, "initialize, Clearing the device ID storage");
|
921 |
| - localStorage.removeItem(this.app_key + "/cly_id"); |
922 |
| - localStorage.removeItem(this.app_key + "/cly_id_type"); |
923 |
| - localStorage.removeItem(this.app_key + "/cly_session"); |
| 921 | + removeValueFromStorage("cly_id"); |
| 922 | + removeValueFromStorage("cly_id_type"); |
| 923 | + removeValueFromStorage("cly_session"); |
924 | 924 | }
|
925 | 925 | checkIgnore();
|
926 | 926 | if (isBrowser) {
|
|
1107 | 1107 | var hasUTM = false;
|
1108 | 1108 | var utms = {};
|
1109 | 1109 | if (searchQuery) {
|
1110 |
| - var parts = searchQuery.substring(1).split("&"); |
| 1110 | + // remove the '?' character from the beginning if it exists |
| 1111 | + if (searchQuery.indexOf('?') === 0) { |
| 1112 | + searchQuery = searchQuery.substring(1); |
| 1113 | + } |
| 1114 | + var parts = searchQuery.split("&"); |
1111 | 1115 | for (var i = 0; i < parts.length; i++) {
|
1112 | 1116 | var nv = parts[i].split("=");
|
1113 | 1117 | if (nv[0] === "cly_id") {
|
|
4003 | 4007 | * Check if user or visit should be ignored
|
4004 | 4008 | */
|
4005 | 4009 | function checkIgnore() {
|
| 4010 | + log(logLevelEnums.INFO, "checkIgnore, Checking if user or visit should be ignored"); |
4006 | 4011 | if (self.ignore_prefetch && isBrowser && typeof document.visibilityState !== "undefined" && document.visibilityState === "prerender") {
|
4007 | 4012 | self.ignore_visitor = true;
|
| 4013 | + log(logLevelEnums.DEBUG, "checkIgnore, Ignoring visit due to prerendering"); |
4008 | 4014 | }
|
4009 | 4015 | if (self.ignore_bots && userAgentSearchBotDetection()) {
|
4010 | 4016 | self.ignore_visitor = true;
|
| 4017 | + log(logLevelEnums.DEBUG, "checkIgnore, Ignoring visit due to bot"); |
4011 | 4018 | }
|
4012 | 4019 | }
|
4013 | 4020 |
|
|
0 commit comments