Skip to content

Commit

Permalink
Fix tracker regex for events.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Oct 14, 2020
1 parent 56ccdf8 commit e0a7fd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tracker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e0a7fd9

Please sign in to comment.