Skip to content
Snippets Groups Projects
Commit ff9f95ea authored by Uku Taht's avatar Uku Taht
Browse files

Fix old script

parent f203eba7
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
// with some early customers. This script uses a cookie but this was an old version of Plausible. // with some early customers. This script uses a cookie but this was an old version of Plausible.
// Current script can be found in the tracker/src/plausible.js file // Current script can be found in the tracker/src/plausible.js file
(function(window, plausibleHost){ (function(){
'use strict'; 'use strict';
var plausibleHost = new URL(scriptEl.src).origin
function setCookie(name,value) { function setCookie(name,value) {
var date = new Date(); var date = new Date();
date.setTime(date.getTime() + (3*365*24*60*60*1000)); // 3 YEARS date.setTime(date.getTime() + (3*365*24*60*60*1000)); // 3 YEARS
...@@ -117,4 +119,4 @@ ...@@ -117,4 +119,4 @@
} catch (e) { } catch (e) {
new Image().src = plausibleHost + '/api/error?message=' + encodeURIComponent(e.message); new Image().src = plausibleHost + '/api/error?message=' + encodeURIComponent(e.message);
} }
})(window, '<%= base_url %>'); })();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment