Rollup question #4646
Unanswered
Filippo-Marcel-Lisuzzo
asked this question in
Self-Hosted Support
Rollup question
#4646
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I modified and hosted the tracking script in the domain to obtain the sources as a single domain, is there a way to obtain the sources equal to the realtime of the domain in the rollup?
very simply in top source I would like to get the real value of each real time single digit, currently with the script below I can get 8/10% less because obviously it is not made for this job.
!function() {
"use strict";
var a_1 = window.location,
r_1 = window.document,
o_1 = r_1.currentScript,
l_1 = "https://ENDPOINT/api/event";
function s_1(t, e) {
t && console.warn("Ignoring Event: " + t);
e && e.callback && e.callback();
}
function t_1(eventName, e) {
if (/^localhost$|^127(.[0-9]+){0,2}.[0-9]+$|^[::1?]$/.test(a_1.hostname) || "file:" === a_1.protocol) {
return s_1("localhost", e);
}
if ((window._phantom || window.__nightmare || window.navigator.webdriver || window.Cypress) && !window.__plausible_1) {
return s_1(null, e);
}
}
var e_1 = window.plausible_1 && window.plausible_1.q || [];
window.plausible_1 = t_1;
for (var i_1, n_1 = 0; n_1 < e_1.length; n_1++) {
t_1.apply(this, e_1[n_1]);
}
function p_1() {
if (i_1 !== a_1.pathname) {
i_1 = a_1.pathname;
t_1("pageview");
}
}
var c_1, u_1 = window.history;
u_1.pushState && (c_1 = u_1.pushState, u_1.pushState = function() {
c_1.apply(this, arguments);
p_1();
});
window.addEventListener("popstate", p_1);
"prerender" === r_1.visibilityState
? r_1.addEventListener("visibilitychange", function() {
i_1 || "visible" !== r_1.visibilityState || p_1();
})
: p_1();
document.addEventListener("click", function(event) {
var target = event.target;
if (target.matches(".track-click")) {
t_1("click", { props: { id: target.id, class: target.className } });
}
});
}();
Beta Was this translation helpful? Give feedback.
All reactions