Report error and success events to Matomo
parent
a84c923fed
commit
83f581de5d
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
|
||||
function sendErrorReport(category, error, errordata) {
|
||||
if (getStorage("analytics") !== "false") {
|
||||
try {
|
||||
if (typeof errordata == "undefined") {
|
||||
_paq.push(['trackEvent', 'Error', category, error]);
|
||||
} else {
|
||||
_paq.push(['trackEvent', 'Error', category, error, errordata]);
|
||||
}
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendActionReport(category, action, data) {
|
||||
if (getStorage("analytics") !== "false") {
|
||||
try {
|
||||
if (typeof data == "undefined") {
|
||||
_paq.push(['trackEvent', 'User Action', category, action]);
|
||||
} else {
|
||||
_paq.push(['trackEvent', 'User Action', category, action, data]);
|
||||
}
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function trackPageView(url, title) {
|
||||
if (getStorage("analytics") !== "false") {
|
||||
try {
|
||||
_paq.push(['setCustomUrl', "https://app.helena.express" + url]);
|
||||
_paq.push(['setDocumentTitle', title]);
|
||||
_paq.push(['trackPageView']);
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue