Skip to content

Commit 34e4346

Browse files
authored
Merge pull request #15855 from ethereum/tracking-11521
fix: differentiate events with locale [Fixes #11521]
2 parents 3a5d0b1 + 036f484 commit 34e4346

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

src/components/FindWalletProductTable/hooks/useWalletFilters.tsx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useRef } from "react"
2+
import { useLocale } from "next-intl"
23

34
import { FilterOption } from "@/lib/types"
45

@@ -36,6 +37,7 @@ import { DEFAULT_LOCALE } from "@/lib/constants"
3637
import { useTranslation } from "@/hooks/useTranslation"
3738

3839
export const useWalletFilters = (): FilterOption[] => {
40+
const locale = useLocale()
3941
const { t } = useTranslation("page-wallets-find-wallet")
4042
const prevNetworkArray = useRef<string[]>([])
4143
return [
@@ -95,7 +97,7 @@ export const useWalletFilters = (): FilterOption[] => {
9597
) => {
9698
trackCustomEvent({
9799
eventCategory: "WalletFilterSidebar",
98-
eventAction: `${t("page-find-wallet-android")}`,
100+
eventAction: `${locale} - ${t("page-find-wallet-android")}`,
99101
eventName: `android ${newInputState}`,
100102
})
101103
updateFilterState(
@@ -136,7 +138,7 @@ export const useWalletFilters = (): FilterOption[] => {
136138
) => {
137139
trackCustomEvent({
138140
eventCategory: "WalletFilterSidebar",
139-
eventAction: `${t("page-find-wallet-iOS")}`,
141+
eventAction: `${locale} - ${t("page-find-wallet-iOS")}`,
140142
eventName: `iOS ${newInputState}`,
141143
})
142144
updateFilterState(
@@ -168,7 +170,7 @@ export const useWalletFilters = (): FilterOption[] => {
168170
updateFilterState={(filterIndex, itemIndex, newInputState) => {
169171
trackCustomEvent({
170172
eventCategory: "WalletFilterSidebar",
171-
eventAction: `${t("page-find-wallet-desktop")}`,
173+
eventAction: `${locale} - ${t("page-find-wallet-desktop")}`,
172174
eventName: `desktop ${newInputState}`,
173175
})
174176
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -204,7 +206,7 @@ export const useWalletFilters = (): FilterOption[] => {
204206
) => {
205207
trackCustomEvent({
206208
eventCategory: "WalletFilterSidebar",
207-
eventAction: `${t("page-find-wallet-linux")}`,
209+
eventAction: `${locale} - ${t("page-find-wallet-linux")}`,
208210
eventName: `linux ${newInputState}`,
209211
})
210212
updateFilterState(
@@ -245,7 +247,7 @@ export const useWalletFilters = (): FilterOption[] => {
245247
) => {
246248
trackCustomEvent({
247249
eventCategory: "WalletFilterSidebar",
248-
eventAction: `${t("page-find-wallet-windows")}`,
250+
eventAction: `${locale} - ${t("page-find-wallet-windows")}`,
249251
eventName: `windows ${newInputState}`,
250252
})
251253
updateFilterState(
@@ -286,7 +288,7 @@ export const useWalletFilters = (): FilterOption[] => {
286288
) => {
287289
trackCustomEvent({
288290
eventCategory: "WalletFilterSidebar",
289-
eventAction: `${t("page-find-wallet-macOS")}`,
291+
eventAction: `${locale} - ${t("page-find-wallet-macOS")}`,
290292
eventName: `macOS ${newInputState}`,
291293
})
292294
updateFilterState(
@@ -318,7 +320,7 @@ export const useWalletFilters = (): FilterOption[] => {
318320
updateFilterState={(filterIndex, itemIndex, newInputState) => {
319321
trackCustomEvent({
320322
eventCategory: "WalletFilterSidebar",
321-
eventAction: `${t("page-find-wallet-browser")}`,
323+
eventAction: `${locale} - ${t("page-find-wallet-browser")}`,
322324
eventName: `browser ${newInputState}`,
323325
})
324326
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -354,7 +356,7 @@ export const useWalletFilters = (): FilterOption[] => {
354356
) => {
355357
trackCustomEvent({
356358
eventCategory: "WalletFilterSidebar",
357-
eventAction: `${t("page-find-wallet-chromium")}`,
359+
eventAction: `${locale} - ${t("page-find-wallet-chromium")}`,
358360
eventName: `chromium ${newInputState}`,
359361
})
360362
updateFilterState(
@@ -395,7 +397,7 @@ export const useWalletFilters = (): FilterOption[] => {
395397
) => {
396398
trackCustomEvent({
397399
eventCategory: "WalletFilterSidebar",
398-
eventAction: `${t("page-find-wallet-firefox")}`,
400+
eventAction: `${locale} - ${t("page-find-wallet-firefox")}`,
399401
eventName: `firefox ${newInputState}`,
400402
})
401403
updateFilterState(
@@ -427,7 +429,7 @@ export const useWalletFilters = (): FilterOption[] => {
427429
updateFilterState={(filterIndex, itemIndex, newInputState) => {
428430
trackCustomEvent({
429431
eventCategory: "WalletFilterSidebar",
430-
eventAction: `${t("page-find-wallet-hardware")}`,
432+
eventAction: `${locale} - ${t("page-find-wallet-hardware")}`,
431433
eventName: `hardware ${newInputState}`,
432434
})
433435
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -522,7 +524,7 @@ export const useWalletFilters = (): FilterOption[] => {
522524
updateFilterState={(filterIndex, itemIndex, newInputState) => {
523525
trackCustomEvent({
524526
eventCategory: "WalletFilterSidebar",
525-
eventAction: `${t("page-find-wallet-buy-crypto")}`,
527+
eventAction: `${locale} - ${t("page-find-wallet-buy-crypto")}`,
526528
eventName: `buy_crypto ${newInputState}`,
527529
})
528530
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -549,7 +551,7 @@ export const useWalletFilters = (): FilterOption[] => {
549551
updateFilterState={(filterIndex, itemIndex, newInputState) => {
550552
trackCustomEvent({
551553
eventCategory: "WalletFilterSidebar",
552-
eventAction: `${t("page-find-wallet-sell-for-fiat")}`,
554+
eventAction: `${locale} - ${t("page-find-wallet-sell-for-fiat")}`,
553555
eventName: `withdraw_crypto ${newInputState}`,
554556
})
555557
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -582,7 +584,7 @@ export const useWalletFilters = (): FilterOption[] => {
582584
updateFilterState={(filterIndex, itemIndex, newInputState) => {
583585
trackCustomEvent({
584586
eventCategory: "WalletFilterSidebar",
585-
eventAction: `${t("page-find-wallet-connect-to-dapps")}`,
587+
eventAction: `${locale} - ${t("page-find-wallet-connect-to-dapps")}`,
586588
eventName: `connect_to_dapps ${newInputState}`,
587589
})
588590
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -609,7 +611,7 @@ export const useWalletFilters = (): FilterOption[] => {
609611
updateFilterState={(filterIndex, itemIndex, newInputState) => {
610612
trackCustomEvent({
611613
eventCategory: "WalletFilterSidebar",
612-
eventAction: `${t("page-find-wallet-nft-support")}`,
614+
eventAction: `${locale} - ${t("page-find-wallet-nft-support")}`,
613615
eventName: `nft_support ${newInputState}`,
614616
})
615617
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -636,7 +638,7 @@ export const useWalletFilters = (): FilterOption[] => {
636638
updateFilterState={(filterIndex, itemIndex, newInputState) => {
637639
trackCustomEvent({
638640
eventCategory: "WalletFilterSidebar",
639-
eventAction: `${t("page-find-wallet-staking")}`,
641+
eventAction: `${locale} - ${t("page-find-wallet-staking")}`,
640642
eventName: `staking ${newInputState}`,
641643
})
642644
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -663,7 +665,7 @@ export const useWalletFilters = (): FilterOption[] => {
663665
updateFilterState={(filterIndex, itemIndex, newInputState) => {
664666
trackCustomEvent({
665667
eventCategory: "WalletFilterSidebar",
666-
eventAction: `${t("page-find-wallet-layer-2")}`,
668+
eventAction: `${locale} - ${t("page-find-wallet-layer-2")}`,
667669
eventName: `layer_2 ${newInputState}`,
668670
})
669671
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -690,7 +692,7 @@ export const useWalletFilters = (): FilterOption[] => {
690692
updateFilterState={(filterIndex, itemIndex, newInputState) => {
691693
trackCustomEvent({
692694
eventCategory: "WalletFilterSidebar",
693-
eventAction: `${t("page-find-wallet-swaps")}`,
695+
eventAction: `${locale} - ${t("page-find-wallet-swaps")}`,
694696
eventName: `swaps ${newInputState}`,
695697
})
696698
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -717,7 +719,7 @@ export const useWalletFilters = (): FilterOption[] => {
717719
updateFilterState={(filterIndex, itemIndex, newInputState) => {
718720
trackCustomEvent({
719721
eventCategory: "WalletFilterSidebar",
720-
eventAction: `${t("page-find-wallet-hardware-wallet-support")}`,
722+
eventAction: `${locale} - ${t("page-find-wallet-hardware-wallet-support")}`,
721723
eventName: `hardware_support ${newInputState}`,
722724
})
723725
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -744,7 +746,7 @@ export const useWalletFilters = (): FilterOption[] => {
744746
updateFilterState={(filterIndex, itemIndex, newInputState) => {
745747
trackCustomEvent({
746748
eventCategory: "WalletFilterSidebar",
747-
eventAction: `${t("page-find-wallet-ens-support")}`,
749+
eventAction: `${locale} - ${t("page-find-wallet-ens-support")}`,
748750
eventName: `ens_support ${newInputState}`,
749751
})
750752
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -777,7 +779,7 @@ export const useWalletFilters = (): FilterOption[] => {
777779
updateFilterState={(filterIndex, itemIndex, newInputState) => {
778780
trackCustomEvent({
779781
eventCategory: "WalletFilterSidebar",
780-
eventAction: `${t("page-find-wallet-open-source")}`,
782+
eventAction: `${locale} - ${t("page-find-wallet-open-source")}`,
781783
eventName: `open_source ${newInputState}`,
782784
})
783785
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -804,7 +806,7 @@ export const useWalletFilters = (): FilterOption[] => {
804806
updateFilterState={(filterIndex, itemIndex, newInputState) => {
805807
trackCustomEvent({
806808
eventCategory: "WalletFilterSidebar",
807-
eventAction: `${t("page-find-wallet-non-custodial")}`,
809+
eventAction: `${locale} - ${t("page-find-wallet-non-custodial")}`,
808810
eventName: `non_custodial ${newInputState}`,
809811
})
810812
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -837,7 +839,7 @@ export const useWalletFilters = (): FilterOption[] => {
837839
updateFilterState={(filterIndex, itemIndex, newInputState) => {
838840
trackCustomEvent({
839841
eventCategory: "WalletFilterSidebar",
840-
eventAction: `${t("page-find-wallet-multisig")}`,
842+
eventAction: `${locale} - ${t("page-find-wallet-multisig")}`,
841843
eventName: `multisig ${newInputState}`,
842844
})
843845
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -864,7 +866,7 @@ export const useWalletFilters = (): FilterOption[] => {
864866
updateFilterState={(filterIndex, itemIndex, newInputState) => {
865867
trackCustomEvent({
866868
eventCategory: "WalletFilterSidebar",
867-
eventAction: `${t("page-find-wallet-social-recovery")}`,
869+
eventAction: `${locale} - ${t("page-find-wallet-social-recovery")}`,
868870
eventName: `social_recovery ${newInputState}`,
869871
})
870872
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -897,7 +899,7 @@ export const useWalletFilters = (): FilterOption[] => {
897899
updateFilterState={(filterIndex, itemIndex, newInputState) => {
898900
trackCustomEvent({
899901
eventCategory: "WalletFilterSidebar",
900-
eventAction: `${t("page-find-wallet-rpc-importing")}`,
902+
eventAction: `${locale} - ${t("page-find-wallet-rpc-importing")}`,
901903
eventName: `rpc_importing ${newInputState}`,
902904
})
903905
updateFilterState(filterIndex, itemIndex, newInputState)
@@ -924,7 +926,7 @@ export const useWalletFilters = (): FilterOption[] => {
924926
updateFilterState={(filterIndex, itemIndex, newInputState) => {
925927
trackCustomEvent({
926928
eventCategory: "WalletFilterSidebar",
927-
eventAction: `${t("page-find-wallet-token-importing")}`,
929+
eventAction: `${locale} - ${t("page-find-wallet-token-importing")}`,
928930
eventName: `erc_20_support ${newInputState}`,
929931
})
930932
updateFilterState(filterIndex, itemIndex, newInputState)

0 commit comments

Comments
 (0)