Skip to content

Commit

Permalink
Merge branch 'develop' into issues/8625/fix-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
syedfardeenjeelani authored Sep 26, 2024
2 parents 60b169e + f1e96cf commit b5f92aa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Common/hooks/useFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PaginationComponent from "../../Components/Common/Pagination";
import { classNames, humanizeStrings } from "../../Utils/utils";
import FiltersCache from "../../Utils/FiltersCache";
import careConfig from "@careConfig";
import { triggerGoal } from "../../Integrations/Plausible";

export type FilterState = Record<string, unknown>;

Expand Down Expand Up @@ -42,6 +43,17 @@ export default function useFilters({
) => {
query = FiltersCache.utils.clean(query);
_setQueryParams(query, options);

// For each of the newly applied filters (additional filters compared to
// previously applied ones), trigger a plausible goal "Advanced filter
// applied" with the applied filter's query key and current location as tags.
Object.keys(query).forEach((filter) =>
triggerGoal("Advanced filter applied", {
filter,
location: location.pathname,
}),
);

updateCache(query);
};

Expand Down

0 comments on commit b5f92aa

Please sign in to comment.