mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Fix tracker regex for events.
This commit is contained in:
parent
56ccdf8c8e
commit
e0a7fd9ec4
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "0.92.0",
|
"version": "0.96.0",
|
||||||
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -110,7 +110,7 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
const addEvents = () => {
|
const addEvents = () => {
|
||||||
document.querySelectorAll("[class*='umami--']").forEach(element => {
|
document.querySelectorAll("[class*='umami--']").forEach(element => {
|
||||||
element.className.split(' ').forEach(className => {
|
element.className.split(' ').forEach(className => {
|
||||||
if (/^umami--([a-z]+)--([a-z0-9_]+[a-z0-9-_]+)$/.test(className)) {
|
if (/^umami--([a-z]+)--([\w]+[\w-]*)$/.test(className)) {
|
||||||
const [, type, value] = className.split('--');
|
const [, type, value] = className.split('--');
|
||||||
const listener = () => trackEvent(value, type);
|
const listener = () => trackEvent(value, type);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user