diff options
| author | Christine Dodrill <me@christine.website> | 2019-10-15 21:21:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-15 21:21:40 -0400 |
| commit | 42556bb678032805c47f126d6e832242eeb85d5b (patch) | |
| tree | 40dc13545ff47bd65ff38088084596f94eae0051 | |
| parent | f7327f2d5adb1ce46771acf6ac88d4bbf342cef3 (diff) | |
| download | xesite-42556bb678032805c47f126d6e832242eeb85d5b.tar.xz xesite-42556bb678032805c47f126d6e832242eeb85d5b.zip | |
kill pageview timer experiment (#83)
| -rw-r--r-- | blog/pageview-time-experiment-2019-08-19.markdown | 7 | ||||
| -rw-r--r-- | static/js/pageview_timer.js | 31 | ||||
| -rwxr-xr-x | static/js/sw.js | 2 | ||||
| -rw-r--r-- | templates/blogpost.html | 3 |
4 files changed, 8 insertions, 35 deletions
diff --git a/blog/pageview-time-experiment-2019-08-19.markdown b/blog/pageview-time-experiment-2019-08-19.markdown index ecb3b8d..85e4395 100644 --- a/blog/pageview-time-experiment-2019-08-19.markdown +++ b/blog/pageview-time-experiment-2019-08-19.markdown @@ -70,3 +70,10 @@ benefit in that timespan, I will disable this and post a follow-up explaining ho I believe it wasn't useful. Thanks and be well. + +--- + +EDIT 2019-10-15: browsers disable this call from the context I am using and I don't +really care enough to figure out how to fix it. This experiment is over. Thank you +to everyone that participated. All data will be scrubbed and a followup will be +posted soon. diff --git a/static/js/pageview_timer.js b/static/js/pageview_timer.js deleted file mode 100644 index 2761396..0000000 --- a/static/js/pageview_timer.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - Hi, - - If you are reading this, you have found this script in the referenced scripts - for pages on this site. I know you're gonna have to take me at my word on this, - but I'm literally using this to collect how much time people spend reading my - webpages. See metrics here: https://christine.website/metrics - - If you have the "do not track" setting enabled in your browser, this code will - be ineffectual. -*/ - -(function() { - let dnt = navigator.doNotTrack; - if (dnt === "1") { - return; - } - - let startTime = new Date(); - - function logTime() { - let stopTime = new Date(); - window.navigator.sendBeacon("/api/pageview-timer", JSON.stringify({ - "path": window.location.pathname, - "start_time": startTime.toISOString(), - "end_time": stopTime.toISOString() - })); - } - - window.addEventListener("pagehide", logTime, false); -})(); diff --git a/static/js/sw.js b/static/js/sw.js index deaa947..62722a6 100755 --- a/static/js/sw.js +++ b/static/js/sw.js @@ -5,7 +5,7 @@ self.addEventListener('install', function(event) { event.waitUntil(preLoad());
});
-const cacheName = "cache-2019-05-21";
+const cacheName = "cache-2019-10-15";
var preLoad = function(){
console.log('[PWA Builder] Install Event processing');
diff --git a/templates/blogpost.html b/templates/blogpost.html index c4953a9..5b09d75 100644 --- a/templates/blogpost.html +++ b/templates/blogpost.html @@ -18,9 +18,6 @@ <link rel="canonical" href="https://christine.website/{{ .Link }}"> -<!-- Metrics --> -<script src="/static/js/pageview_timer.js"></script> - <script type="application/ld+json"> { "@context": "http://schema.org", |
