From 7df07243252cc94124f38cc1d672d5d441818a51 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Wed, 22 Jun 2022 10:32:47 -0700 Subject: [PATCH] track gallery sort events in analytics --- src/pages/photogallery.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pages/photogallery.js b/src/pages/photogallery.js index 0104707..d6ad8b3 100644 --- a/src/pages/photogallery.js +++ b/src/pages/photogallery.js @@ -17,6 +17,13 @@ const GalleryPage = ({ data }) => { const [sortKey, _setSortKey] = React.useState("hue"); const setSortKey = React.useCallback( (key) => { + try { + window.plausible("Sort Gallery", { + props: { key } + }) + } catch (e) { + // do nothing + } localStorage?.setItem("photogallery.sortkey", key); _setSortKey(key); },