Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Add tracking to filter button (#3928)

Uku Taht8992c8ee07e6
diff --git a/assets/js/dashboard/filters.js b/assets/js/dashboard/filters.js
index 784b7c600b..85bc88d244 100644
--- a/assets/js/dashboard/filters.js
+++ b/assets/js/dashboard/filters.js
@@ -258,6 +258,10 @@ class Filters extends React.Component {
)
}
+ trackFilterMenu() {
+ window.plausible && window.plausible('Filter Menu: Open')
+ }
+
renderDropDown() {
const { history, query, site } = this.props;
@@ -266,7 +270,7 @@ class Filters extends React.Component {
{({ open }) => (
<>
<div>
- <Menu.Button className="flex items-center text-xs md:text-sm font-medium leading-tight px-3 py-2 cursor-pointer ml-auto text-gray-500 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-900 rounded">
+ <Menu.Button onClick={this.trackFilterMenu} className="flex items-center text-xs md:text-sm font-medium leading-tight px-3 py-2 cursor-pointer ml-auto text-gray-500 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-900 rounded">
{this.renderDropdownButton()}
</Menu.Button>
</div>