mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Allow custom events.
This commit is contained in:
parent
fd8df387c8
commit
0aa6cc939a
@ -61,12 +61,13 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
const handlePush = (state, title, navigatedURL) => {
|
const handlePush = (state, title, navigatedURL) => {
|
||||||
removeEvents();
|
removeEvents();
|
||||||
currentRef = currentUrl;
|
currentRef = currentUrl;
|
||||||
|
const newUrl = navigatedURL.toString();
|
||||||
|
|
||||||
if (navigatedURL.toString().startsWith('http')) {
|
if (newUrl.startsWith('http')) {
|
||||||
const url = new URL(navigatedURL.toString());
|
const url = new URL(newUrl);
|
||||||
currentUrl = `${url.pathname}${url.search}`;
|
currentUrl = `${url.pathname}${url.search}`;
|
||||||
} else {
|
} else {
|
||||||
currentUrl = navigatedURL.toString();
|
currentUrl = newUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
pageView();
|
pageView();
|
||||||
@ -101,4 +102,8 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
/* Start */
|
/* Start */
|
||||||
|
|
||||||
pageView();
|
pageView();
|
||||||
|
|
||||||
|
if (!window.umami) {
|
||||||
|
window.umami = event_value => collect('event', { event_type: 'custom', event_value });
|
||||||
|
}
|
||||||
})(window);
|
})(window);
|
||||||
|
Loading…
Reference in New Issue
Block a user