Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix tracker regex for events.

Mike Caoe0a7fd9ec4d3
diff --git a/package.json b/package.json
index 8383c8c67..1f26ba1eb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "umami",
- "version": "0.92.0",
+ "version": "0.96.0",
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <[email protected]>",
"license": "MIT",
diff --git a/tracker/index.js b/tracker/index.js
index 3ad8ad3de..ff0ce28d6 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -110,7 +110,7 @@ import { removeTrailingSlash } from '../lib/url';
const addEvents = () => {
document.querySelectorAll("[class*='umami--']").forEach(element => {
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 listener = () => trackEvent(value, type);