From 649117b1bf9917d324a7b179f9bf78acb4503224 Mon Sep 17 00:00:00 2001 From: Rendall Date: Fri, 18 Sep 2020 13:35:57 +0300 Subject: [PATCH] Allow tracking to specify event types other than 'custom' A very minimal change to this line `window.umami = event_value => collect('event', { event_type: 'custom', event_value });` to include a second value does not break current uses --- tracker/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracker/index.js b/tracker/index.js index f7f00927..d2a44531 100644 --- a/tracker/index.js +++ b/tracker/index.js @@ -104,6 +104,7 @@ import { removeTrailingSlash } from '../lib/url'; pageView(); if (!window.umami) { - window.umami = event_value => collect('event', { event_type: 'custom', event_value }); + window.umami = (event_value, event_type = 'custom') => + collect('event', { event_type, event_value }); } })(window);