|
8 | 8 | version, |
9 | 9 | defaultNamespace, |
10 | 10 | sendError, |
11 | | - warn |
| 11 | + warn, |
12 | 12 | ) { |
13 | 13 | try { |
14 | 14 | ///////////////////// |
|
117 | 117 | return Array.isArray(csv) |
118 | 118 | ? csv |
119 | 119 | : isString(csv) && csv.length |
120 | | - ? csv.split(/, ?/) |
121 | | - : []; |
| 120 | + ? csv.split(/, ?/) |
| 121 | + : []; |
122 | 122 | }; |
123 | 123 |
|
124 | 124 | var isObject = function (object) { |
|
152 | 152 | /** if ignoremetrics **/ |
153 | 153 | // Customers can skip data points |
154 | 154 | var ignoreMetrics = convertCommaSeparatedToArray( |
155 | | - overwriteOptions.ignoreMetrics || attr(scriptElement, "ignore-metrics") |
| 155 | + overwriteOptions.ignoreMetrics || attr(scriptElement, "ignore-metrics"), |
156 | 156 | ); |
157 | 157 | /** endif **/ |
158 | 158 |
|
|
205 | 205 | defaultNamespace; |
206 | 206 |
|
207 | 207 | /** if metadata **/ |
208 | | - var metadataObject = window[namespace + "_metadata"]; |
209 | 208 | var appendMetadata = function (metadata, data) { |
| 209 | + var metadataObject = window[namespace + "_metadata"]; |
210 | 210 | if (isObject(metadataObject)) metadata = assign(metadata, metadataObject); |
211 | 211 | var metadataCollectorFunction = window[metadataCollector]; |
212 | 212 | if (!isFunction(metadataCollectorFunction)) return metadata; |
213 | 213 | try { |
214 | 214 | return assign( |
215 | 215 | metadata, |
216 | | - metadataCollectorFunction.call(window, assign(metadata, data)) |
| 216 | + metadataCollectorFunction.call(window, assign(metadata, data)), |
217 | 217 | ); |
218 | 218 | } catch (error) { |
219 | 219 | warnInFunction("metadata", error); |
|
284 | 284 | ignorePage === path || |
285 | 285 | new RegExp( |
286 | 286 | "^" + filterRegex(ignorePage).replace(/\\\*/gi, "(.*)") + "$", |
287 | | - "i" |
| 287 | + "i", |
288 | 288 | ).test(path) |
289 | 289 | ) |
290 | 290 | return trueVar; |
|
374 | 374 | path: loc.pathname, |
375 | 375 | }), |
376 | 376 | undefinedVar, |
377 | | - trueVar |
| 377 | + trueVar, |
378 | 378 | ); |
379 | 379 | }; |
380 | 380 |
|
|
387 | 387 | sendError(event.message); |
388 | 388 | } |
389 | 389 | }, |
390 | | - falseVar |
| 390 | + falseVar, |
391 | 391 | ); |
392 | 392 | /** endif **/ |
393 | 393 |
|
|
438 | 438 | /** if ignorepages **/ |
439 | 439 | // Customers can ignore certain pages |
440 | 440 | var ignorePages = convertCommaSeparatedToArray( |
441 | | - overwriteOptions.ignorePages || attr(scriptElement, "ignore-pages") |
| 441 | + overwriteOptions.ignorePages || attr(scriptElement, "ignore-pages"), |
442 | 442 | ); |
443 | 443 | /** endif **/ |
444 | 444 |
|
445 | 445 | /** if allowparams **/ |
446 | 446 | // Customers can allow params |
447 | 447 | var allowParams = convertCommaSeparatedToArray( |
448 | | - overwriteOptions.allowParams || attr(scriptElement, "allow-params") |
| 448 | + overwriteOptions.allowParams || attr(scriptElement, "allow-params"), |
449 | 449 | ); |
450 | 450 | /** endif **/ |
451 | 451 |
|
452 | 452 | /** if nonuniquehostnames **/ |
453 | 453 | // Customers can allow params |
454 | 454 | var nonUniqueHostnames = convertCommaSeparatedToArray( |
455 | 455 | overwriteOptions.nonUniqueHostnames || |
456 | | - attr(scriptElement, "non-unique-hostnames") |
| 456 | + attr(scriptElement, "non-unique-hostnames"), |
457 | 457 | ); |
458 | 458 | /** endif **/ |
459 | 459 |
|
|
553 | 553 | /** if ignorednt **/ |
554 | 554 | if (!collectDnt && doNotTrack in nav && nav[doNotTrack] == "1") |
555 | 555 | return warn( |
556 | | - notSendingWhen + doNotTrack + " is enabled. See " + docsUrl + "/dnt" |
| 556 | + notSendingWhen + doNotTrack + " is enabled. See " + docsUrl + "/dnt", |
557 | 557 | ); |
558 | 558 | /** else **/ |
559 | 559 | if (doNotTrack in nav && nav[doNotTrack] == "1") |
560 | 560 | return warn( |
561 | | - notSendingWhen + doNotTrack + " is enabled. See " + docsUrl + "/dnt" |
| 561 | + notSendingWhen + doNotTrack + " is enabled. See " + docsUrl + "/dnt", |
562 | 562 | ); |
563 | 563 | /** endif **/ |
564 | 564 |
|
|
573 | 573 | locationHostname + |
574 | 574 | ". See " + |
575 | 575 | docsUrl + |
576 | | - "/overwrite-domain-name" |
| 576 | + "/overwrite-domain-name", |
577 | 577 | ); |
578 | 578 |
|
579 | 579 | ///////////////////// |
|
644 | 644 | hiddenStart = now(); |
645 | 645 | } else msHidden += now() - hiddenStart; |
646 | 646 | }, |
647 | | - falseVar |
| 647 | + falseVar, |
648 | 648 | ); |
649 | 649 | /** endif **/ |
650 | 650 |
|
|
660 | 660 | body[offsetHeight] || 0, |
661 | 661 | documentElement[clientHeight] || 0, |
662 | 662 | documentElement[scrollHeight] || 0, |
663 | | - documentElement[offsetHeight] || 0 |
| 663 | + documentElement[offsetHeight] || 0, |
664 | 664 | ); |
665 | 665 | return Math.min( |
666 | 666 | 100, |
667 | 667 | Math.round( |
668 | 668 | (100 * ((documentElement.scrollTop || 0) + documentClientHeight)) / |
669 | 669 | height / |
670 | | - 5 |
671 | | - ) * 5 |
| 670 | + 5, |
| 671 | + ) * 5, |
672 | 672 | ); |
673 | 673 | } catch (error) { |
674 | 674 | warn(error); |
|
683 | 683 | function () { |
684 | 684 | if (scrolled < position()) scrolled = position(); |
685 | 685 | }, |
686 | | - falseVar |
| 686 | + falseVar, |
687 | 687 | ); |
688 | 688 | }); |
689 | 689 | /** endif **/ |
|
737 | 737 | isPushState, |
738 | 738 | deleteSourceInfo, |
739 | 739 | sameSite, |
740 | | - metadata |
| 740 | + metadata, |
741 | 741 | ) { |
742 | 742 | if (isPushState) sendOnLeave("" + payload.page_id, trueVar); |
743 | 743 | if (collectDataOnLeave) payload.page_id = uuid(); |
|
782 | 782 | page.viewport_height = |
783 | 783 | Math.max( |
784 | 784 | documentElement[clientHeight] || 0, |
785 | | - window.innerHeight || 0 |
| 785 | + window.innerHeight || 0, |
786 | 786 | ) || null; |
787 | 787 | } |
788 | 788 | /** endif **/ |
|
853 | 853 | isPushState, |
854 | 854 | isPushState || userNavigated || !collectMetricByString("r"), // r = referrers |
855 | 855 | sameSite, |
856 | | - metadata |
| 856 | + metadata, |
857 | 857 | ); |
858 | 858 | }; |
859 | 859 |
|
|
920 | 920 | function () { |
921 | 921 | pageview(1); |
922 | 922 | }, |
923 | | - falseVar |
| 923 | + falseVar, |
924 | 924 | ); |
925 | 925 |
|
926 | 926 | addEventListenerFunc( |
927 | 927 | "popstate", |
928 | 928 | function () { |
929 | 929 | pageview(1); |
930 | 930 | }, |
931 | | - falseVar |
| 931 | + falseVar, |
932 | 932 | ); |
933 | 933 | } |
934 | 934 | /** endif **/ |
|
941 | 941 | function () { |
942 | 942 | pageview(1); |
943 | 943 | }, |
944 | | - falseVar |
| 944 | + falseVar, |
945 | 945 | ); |
946 | 946 | } |
947 | 947 | /** endif **/ |
|
988 | 988 | if (validTypes.indexOf(typeof eventOutput) < 0) { |
989 | 989 | warnInFunction( |
990 | 990 | eventFunctionName, |
991 | | - event + " returns no string: " + eventOutput |
| 991 | + event + " returns no string: " + eventOutput, |
992 | 992 | ); |
993 | 993 | return callback(); |
994 | 994 | } |
|
1022 | 1022 | metadata: stringify(metadata), |
1023 | 1023 | /** endif **/ |
1024 | 1024 | }), |
1025 | | - callback |
| 1025 | + callback, |
1026 | 1026 | ); |
1027 | 1027 | } |
1028 | 1028 | }; |
|
1065 | 1065 | "{{baseUrl}}", |
1066 | 1066 | "{{apiUrlPrefix}}", |
1067 | 1067 | "{{scriptName}}", |
1068 | | - "{{namespace}}" |
| 1068 | + "{{namespace}}", |
1069 | 1069 | ); |
0 commit comments