Skip to content

Commit 10fa144

Browse files
committed
Run npm run build
1 parent 728f670 commit 10fa144

37 files changed

+85
-56
lines changed

dist/latest/auto-events.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/latest/auto-events.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/latest/cloudflare.js

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Simple Analytics - Privacy friendly analytics (docs.simpleanalytics.com/script; 2021-12-28; b9e3; v2) */
1+
/* Simple Analytics - Privacy friendly analytics (docs.simpleanalytics.com/script; 2021-12-30; 26ba; v8) */
22
/* eslint-env browser */
33

44
(function (window, overwriteOptions, baseUrl, apiUrlPrefix, version, saGlobal) {
@@ -51,6 +51,7 @@
5151
var pagehide = "pagehide";
5252
var platformText = "platform";
5353
var platformVersionText = "platformVersion";
54+
var docsUrl = "https://docs.simpleanalytics.com";
5455
var isBotAgent =
5556
/(bot|spider|crawl)/i.test(userAgent) && !/(cubot)/i.test(userAgent);
5657
var screen = window.screen;
@@ -253,10 +254,9 @@
253254
attr(scriptElement, "collect-dnt") == trueText;
254255

255256
// Customers can overwrite their hostname, here we check for that
256-
var definedHostname =
257-
overwriteOptions.hostname ||
258-
attr(scriptElement, "hostname") ||
259-
locationHostname;
257+
var overwrittenHostname =
258+
overwriteOptions.hostname || attr(scriptElement, "hostname");
259+
var definedHostname = overwrittenHostname || locationHostname;
260260

261261
// Some customers want to collect page views manually
262262
var autoCollect = !(
@@ -329,14 +329,28 @@
329329

330330
// Don't track when Do Not Track is set to true
331331
if (!collectDnt && doNotTrack in nav && nav[doNotTrack] == "1")
332-
return warn(notSending + "when " + doNotTrack + " is enabled");
332+
return warn(
333+
notSending +
334+
"when " +
335+
doNotTrack +
336+
" is enabled. See " +
337+
docsUrl +
338+
"/dnt"
339+
);
333340

334-
// Don't track when localhost or when it's an IP address
341+
// Warn when sending from localhost and not having a hostname set
335342
if (
336-
locationHostname.indexOf(".") == -1 ||
337-
/^[0-9]+$/.test(locationHostname.replace(/\./g, ""))
343+
(locationHostname.indexOf(".") == -1 ||
344+
/^[0-9.:]+$/.test(locationHostname)) &&
345+
!overwrittenHostname
338346
)
339-
return warn(notSending + "from " + locationHostname);
347+
warn(
348+
"Set a hostname when sending data from " +
349+
locationHostname +
350+
". See " +
351+
docsUrl +
352+
"/overwrite-domain-name"
353+
);
340354

341355
/////////////////////
342356
// SETUP INITIAL VARIABLES
@@ -709,6 +723,6 @@
709723
{"saGlobal":INSTALL_OPTIONS.sa_global,"mode":INSTALL_OPTIONS.hash_mode ? 'hash' : null,"collectDnt":INSTALL_OPTIONS.collect_dnt},
710724
INSTALL_OPTIONS.custom_domain || "queue.simpleanalyticscdn.com",
711725
"",
712-
"cloudflare_2",
726+
"cloudflare_8",
713727
"sa_event"
714728
);

dist/latest/custom/app.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/latest/custom/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)