From a8ccbb2afe194dac567117e6cc343e483f29c0fa Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Sun, 25 Apr 2021 14:53:54 +0300 Subject: [PATCH 01/20] Added gtm and implemented wallet connect events --- src/gtm/gtm.ts | 6 ++++++ src/main.ts | 1 + src/store/modules/wallet/ethWallet.ts | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 src/gtm/gtm.ts diff --git a/src/gtm/gtm.ts b/src/gtm/gtm.ts new file mode 100644 index 000000000..ea9714a8e --- /dev/null +++ b/src/gtm/gtm.ts @@ -0,0 +1,6 @@ +(function(w:any,d:any,s:any,l:any,i:any) +{w[l]=w[l]||[];w[l].push({'gtm.start': +new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], +j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= +'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); +})(window,document,'script','dataLayer','GTM-TCBKR7W'); \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 78ae5c207..06263124b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,6 +13,7 @@ import "bootstrap-vue/dist/bootstrap-vue.css"; import "@/assets/_scss/main.scss"; import { library } from "@fortawesome/fontawesome-svg-core"; import { fab, fal, fas, far } from "@/assets/fontawesome"; +import './gtm/gtm.ts' import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { sync } from "vuex-router-sync"; diff --git a/src/store/modules/wallet/ethWallet.ts b/src/store/modules/wallet/ethWallet.ts index b35a948c1..7561c9c04 100644 --- a/src/store/modules/wallet/ethWallet.ts +++ b/src/store/modules/wallet/ethWallet.ts @@ -57,9 +57,27 @@ export class EthereumModule extends VuexModule.With({ } @action async connect() { + const dataLayer = window.dataLayer as {}[]; + try { + dataLayer.push({ + "event": "CE Wallet Connect Select a Wallet Popup", + "event_properties": {} + }); await onboard.walletSelect(); + const state = onboard.getState(); + dataLayer.push({ + "event": "CE Wallet Connect Wallet Icon Click", + "event_properties": { + "wallet_id": state.address, + "wallet_name": state.wallet.name + } + }); await onboard.walletCheck(); + dataLayer.push({ + "event": "CE Wallet Connect", + "event_properties": {} + }); } catch (e) { console.error(e, "was the error"); throw new Error(`error: ${e}`); From 4f40b86f07b29c80a39f08d3b88cc4c66c49e514 Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Sun, 25 Apr 2021 17:17:50 +0300 Subject: [PATCH 02/20] Added the conversion events and logs --- src/components/modals/ModalBase.vue | 8 ++++++-- src/components/modals/ModalTxAction.vue | 12 +++++++++++- src/components/swap/SwapMarket.vue | 19 ++++++++++++++++++- src/store/modules/swap/ethBancor.ts | 23 ++++++++++++++++++++--- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/components/modals/ModalBase.vue b/src/components/modals/ModalBase.vue index b992aee66..ee2c67256 100644 --- a/src/components/modals/ModalBase.vue +++ b/src/components/modals/ModalBase.vue @@ -20,7 +20,7 @@ icon="chevron-left" :class="darkMode ? 'text-dark' : 'text-light'" class="cursor" - @click="onHide" + @click="hide" /> @@ -94,6 +94,10 @@ export default class ModalBase extends BaseComponent { ]; } + hide() { + this.show = false; + } + @Emit("onHide") onHide() { this.show = false; diff --git a/src/components/modals/ModalTxAction.vue b/src/components/modals/ModalTxAction.vue index 465b9b0e8..6d76aefcd 100644 --- a/src/components/modals/ModalTxAction.vue +++ b/src/components/modals/ModalTxAction.vue @@ -1,5 +1,10 @@ @@ -44,16 +45,18 @@ import { Component } from "vue-property-decorator"; import ContentBlock from "@/components/common/ContentBlock.vue"; import BaseComponent from "@/components/BaseComponent.vue"; +import SwapMarket from "@/components/swap/SwapMarket.vue"; +import SwapLimit from "@/components/swap/SwapLimit.vue"; @Component({ components: { - ContentBlock + ContentBlock, + SwapLimit, + SwapMarket } }) export default class SwapHome extends BaseComponent { - get limit() { - return this.$route.name === "SwapLimit"; - } + limit = false; } diff --git a/src/components/swap/SwapLimit.vue b/src/components/swap/SwapLimit.vue index 9bd350ac9..b8985ff8a 100644 --- a/src/components/swap/SwapLimit.vue +++ b/src/components/swap/SwapLimit.vue @@ -438,7 +438,7 @@ export default class SwapLimit extends BaseTxAction { } this.$router.replace({ - name: "SwapLimit", + name: "Swap", query: { from: id, to: to @@ -455,7 +455,7 @@ export default class SwapLimit extends BaseTxAction { } this.$router.replace({ - name: "SwapLimit", + name: "Swap", query: { from: from, to: id @@ -465,7 +465,7 @@ export default class SwapLimit extends BaseTxAction { invertSelection() { this.$router.replace({ - name: "SwapLimit", + name: "Swap", query: { from: this.token2.id, to: this.token1.id @@ -746,7 +746,7 @@ export default class SwapLimit extends BaseTxAction { if (this.$route.query.from) defaultQuery.from = this.$route.query.from; // @ts-ignore if (this.$route.query.to) defaultQuery.to = this.$route.query.to; - await this.$router.replace({ name: "SwapLimit", query: defaultQuery }); + await this.$router.replace({ name: "Swap", query: defaultQuery }); } } } diff --git a/src/router/index.ts b/src/router/index.ts index 46cf475e8..db02b6e10 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -6,8 +6,6 @@ import Navigation from "@/components/layout/Navigation.vue"; import { services } from "@/api/helpers"; import PoolActions from "@/components/pool/PoolActions.vue"; import SwapHome from "@/components/swap/SwapHome.vue"; -import SwapMarket from "@/components/swap/SwapMarket.vue"; -import SwapLimit from "@/components/swap/SwapLimit.vue"; import CreateHome from "@/views/CreateHome.vue"; import DataSummary from "@/components/data/DataSummary.vue"; import Portfolio from "@/views/Portfolio.vue"; @@ -225,18 +223,7 @@ export const router = new Router({ key: "swap", feature: "Trade" }, - children: [ - { - path: "", - name: "Swap", - component: SwapMarket - }, - { - path: "limit", - name: "SwapLimit", - component: SwapLimit - } - ] + name: "Swap" }, { path: "/:service/data", diff --git a/src/store/modules/swap/ethBancor.ts b/src/store/modules/swap/ethBancor.ts index 7c5cc90d6..93e6c4cd8 100644 --- a/src/store/modules/swap/ethBancor.ts +++ b/src/store/modules/swap/ethBancor.ts @@ -6023,6 +6023,7 @@ export class EthBancorModule fromId: from.id, toId: to.id }); + const conversion = { conversion_type: "Market", conversion_approve: "Unlimited", From 48706e2457c3c5f9b6a68df64e4e57a265a55d3d Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 16:21:52 +0300 Subject: [PATCH 12/20] Changed event order --- src/store/modules/swap/ethBancor.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/store/modules/swap/ethBancor.ts b/src/store/modules/swap/ethBancor.ts index 93e6c4cd8..5265b9aa5 100644 --- a/src/store/modules/swap/ethBancor.ts +++ b/src/store/modules/swap/ethBancor.ts @@ -6044,6 +6044,11 @@ export class EthBancorModule const ethPath = generateEthPath(fromSymbol, relays); sendGTMEvent("Conversion Swap Click", "Conversion", conversion); + sendGTMEvent( + "Conversion Receipt Confirmation Request", + "Conversion", + conversion + ); onUpdate!(1, steps); await this.triggerApprovalIfRequired({ owner: this.currentUser, @@ -6052,11 +6057,6 @@ export class EthBancorModule tokenAddress: fromTokenContract, onPrompt }); - sendGTMEvent( - "Conversion Receipt Confirmation Request", - "Conversion", - conversion - ); onUpdate!(2, steps); const networkContract = buildNetworkContract(this.contracts.BancorNetwork); @@ -6064,6 +6064,12 @@ export class EthBancorModule const expectedReturn = to.amount; const expectedReturnWei = expandToken(expectedReturn, toTokenDecimals); + sendGTMEvent( + "Conversion Wallet Confirmation Request", + "Conversion", + conversion + ); + const confirmedHash = await this.resolveTxOnConfirmation({ tx: networkContract.methods.convertByPath( ethPath.path, @@ -6091,11 +6097,7 @@ export class EthBancorModule resolveImmediately: true, ...(fromIsEth && { value: fromWei }), onHash: () => { - sendGTMEvent( - "Conversion Wallet Confirmation Request", - "Conversion", - conversion - ); + sendGTMEvent("Conversion Wallet Confirmed", "Conversion", conversion); return onUpdate!(3, steps); } }); From 224af52c340c2621b9a190f88ebfb348d1c8705d Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 16:29:38 +0300 Subject: [PATCH 13/20] added eth usd price --- src/store/modules/swap/ethBancor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/swap/ethBancor.ts b/src/store/modules/swap/ethBancor.ts index d380514e2..be0854ec4 100644 --- a/src/store/modules/swap/ethBancor.ts +++ b/src/store/modules/swap/ethBancor.ts @@ -6083,7 +6083,7 @@ export class EthBancorModule sendGTMEvent("Conversion Success", "Conversion", { conversion, conversion_success: { - conversion_market_eth_usd_rate: "", + conversion_market_eth_usd_rate: this.stats.nativeTokenPrice.price, conversion_market_token_rate: fromToken.price?.toFixed(10) }, transaction: { From 0f9b923a5437842f578b656b5742a5614c3e6fac Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 17:16:57 +0300 Subject: [PATCH 14/20] added gtm to staging header --- firebase.json | 75 +++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/firebase.json b/firebase.json index 8ad7f2cac..95d3dca90 100644 --- a/firebase.json +++ b/firebase.json @@ -1,46 +1,39 @@ { - "hosting": [ { - "target": "production", - "public": "dist", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ], - "rewrites": [ - { - "source": "**", - "destination": "/index.html" - } - ], - "headers": [ - { - "source": "**/*", - "headers": [ - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "X-XSS-Protection", - "value": "1; mode=block" - } - ] - } - ] - }, + "hosting": [ { - "target": "staging", + "target": "production", "public": "dist", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } ], + "headers": [ + { + "source": "**/*", + "headers": [ + { + "key": "X-Content-Type-Options", + "value": "nosniff" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + }, + { + "key": "X-XSS-Protection", + "value": "1; mode=block" + } + ] + } + ] + }, + { + "target": "staging", + "public": "dist", + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ { "source": "**", @@ -53,7 +46,7 @@ "headers": [ { "key": "Content-Security-Policy", - "value": "frame-ancestors 'self' https://bancor-v2-beta.web.app https://bancor.network https://*.bancor.network; default-src 'self'; connect-src https://bancor.network https://ropsten-ptdczarhfq-nw.a.run.app/welcome wss://*.blocknative.com https://*.bancor.network https://*.keeperdao.com https://*.sentry.io https://raw.githubusercontent.com/Velua/eth-tokens-registry/master/tokens.json wss://*.alchemyapi.io; font-src https://fonts.gstatic.com; img-src 'self' data: https://etherscan.io https://*.etherscan.io https://raw.githubusercontent.com https://storage.googleapis.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/;" + "value": "frame-ancestors 'self' https://bancor-v2-beta.web.app https://bancor.network https://*.bancor.network; default-src 'self'; connect-src https://bancor.network https://ropsten-ptdczarhfq-nw.a.run.app/welcome wss://*.blocknative.com https://*.bancor.network https://*.keeperdao.com https://*.sentry.io https://raw.githubusercontent.com/Velua/eth-tokens-registry/master/tokens.json wss://*.alchemyapi.io; font-src https://fonts.gstatic.com; img-src 'self' data: https://etherscan.io https://*.etherscan.io https://raw.githubusercontent.com https://storage.googleapis.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js https://www.googletagmanager.com/gtm.js?id=GTM-TCBKR7W; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/;" }, { "key": "X-Content-Type-Options", @@ -72,4 +65,4 @@ ] } ] -} \ No newline at end of file +} From 1bf9e8588083328cb64b14e1e2ac8873643d3ae5 Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 17:32:05 +0300 Subject: [PATCH 15/20] one more --- firebase.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/firebase.json b/firebase.json index 95d3dca90..a41553a5c 100644 --- a/firebase.json +++ b/firebase.json @@ -44,10 +44,6 @@ { "source": "**/*", "headers": [ - { - "key": "Content-Security-Policy", - "value": "frame-ancestors 'self' https://bancor-v2-beta.web.app https://bancor.network https://*.bancor.network; default-src 'self'; connect-src https://bancor.network https://ropsten-ptdczarhfq-nw.a.run.app/welcome wss://*.blocknative.com https://*.bancor.network https://*.keeperdao.com https://*.sentry.io https://raw.githubusercontent.com/Velua/eth-tokens-registry/master/tokens.json wss://*.alchemyapi.io; font-src https://fonts.gstatic.com; img-src 'self' data: https://etherscan.io https://*.etherscan.io https://raw.githubusercontent.com https://storage.googleapis.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js https://www.googletagmanager.com/gtm.js?id=GTM-TCBKR7W; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/;" - }, { "key": "X-Content-Type-Options", "value": "nosniff" From 37e3f95ca2e60c17bd3983e75d9cdc03bc4a063f Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 18:06:28 +0300 Subject: [PATCH 16/20] Undefined instead of empty --- src/gtm/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtm/index.ts b/src/gtm/index.ts index bc7c44652..a4c93a070 100644 --- a/src/gtm/index.ts +++ b/src/gtm/index.ts @@ -32,12 +32,12 @@ const sendGTM = (data: {}) => { export const sendGTMEvent = ( event: string, ga_event_category: string, - event_properties: {} = {} + event_properties: {} | undefined = undefined ) => sendGTM({ event: "CE " + event, event_properties: event_properties, - user_properties: {}, + user_properties: undefined, ga_event: { category: ga_event_category } From 2886bc27dd7148f48b8de464462e313e68e017ff Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 19:00:29 +0300 Subject: [PATCH 17/20] Changed event order and added undefined to VP paths --- src/components/modals/ModalTxAction.vue | 14 +++++++------- src/components/swap/SwapMarket.vue | 10 +++++++++- src/gtm/index.ts | 4 +++- src/store/modules/swap/ethBancor.ts | 22 ++++++---------------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/components/modals/ModalTxAction.vue b/src/components/modals/ModalTxAction.vue index aac22e63c..f598f2d33 100644 --- a/src/components/modals/ModalTxAction.vue +++ b/src/components/modals/ModalTxAction.vue @@ -142,13 +142,6 @@ export default class ModalTxAction extends BaseComponent { onHideCallBack() { if (this.txMetaData.stepIndex <= 1) this.onHide(); - } - - async close() { - if (this.txMetaData.txBusy) return; - if (this.redirectOnSuccess && this.txMetaData.success) { - await this.$router.replace({ name: this.redirectOnSuccess }); - } this.txMetaData = { showTxModal: false, txBusy: false, @@ -159,5 +152,12 @@ export default class ModalTxAction extends BaseComponent { prompt: null }; } + + async close() { + if (this.txMetaData.txBusy) return; + if (this.redirectOnSuccess && this.txMetaData.success) { + await this.$router.replace({ name: this.redirectOnSuccess }); + } + } } diff --git a/src/components/swap/SwapMarket.vue b/src/components/swap/SwapMarket.vue index 8ea1a1faf..bbe9a73cb 100644 --- a/src/components/swap/SwapMarket.vue +++ b/src/components/swap/SwapMarket.vue @@ -326,7 +326,15 @@ export default class SwapAction extends BaseTxAction { conversion_from_amount: this.amount1, conversion_to_amount: this.amount2 }; - this.openModal(); + sendGTMEvent("Conversion Swap Click", "Conversion", conversion); + const notLoggedIn = this.openModal(); + if (!notLoggedIn) + sendGTMEvent( + "Conversion Receipt Confirmation Request", + "Conversion", + conversion + ); + if (this.txMeta.txBusy) return; this.txMeta.txBusy = true; try { diff --git a/src/gtm/index.ts b/src/gtm/index.ts index a4c93a070..670a5a07f 100644 --- a/src/gtm/index.ts +++ b/src/gtm/index.ts @@ -70,5 +70,7 @@ export const sendGTMPath = (from: string | undefined, to: string) => page: { from_path: from, to_path: to - } + }, + user_properties: undefined, + ga_event: undefined }); diff --git a/src/store/modules/swap/ethBancor.ts b/src/store/modules/swap/ethBancor.ts index be0854ec4..06415519c 100644 --- a/src/store/modules/swap/ethBancor.ts +++ b/src/store/modules/swap/ethBancor.ts @@ -6042,13 +6042,7 @@ export class EthBancorModule }; const ethPath = generateEthPath(fromSymbol, relays); - sendGTMEvent("Conversion Swap Click", "Conversion", conversion); - sendGTMEvent( - "Conversion Receipt Confirmation Request", - "Conversion", - conversion - ); onUpdate!(1, steps); await this.triggerApprovalIfRequired({ owner: this.currentUser, @@ -6081,16 +6075,12 @@ export class EthBancorModule ), onConfirmation: () => { sendGTMEvent("Conversion Success", "Conversion", { - conversion, - conversion_success: { - conversion_market_eth_usd_rate: this.stats.nativeTokenPrice.price, - conversion_market_token_rate: fromToken.price?.toFixed(10) - }, - transaction: { - transaction_category: "Conversion", - transaction_id: confirmedHash, - transaction_revenue: "" - } + ...conversion, + conversion_market_eth_usd_rate: this.stats.nativeTokenPrice.price, + conversion_market_token_rate: fromToken.price?.toFixed(10), + transaction_category: "Conversion", + transaction_id: confirmedHash, + transaction_revenue: "" }); return this.spamBalances([fromTokenContract, toTokenContract]); }, From a01156e0d9fee46f80e13cca3df7a50ec9730cfb Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 19:27:52 +0300 Subject: [PATCH 18/20] added dark and light mode tracking --- src/gtm/index.ts | 9 +++++++-- src/router/index.ts | 3 ++- src/store/modules/wallet/ethWallet.ts | 9 +++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gtm/index.ts b/src/gtm/index.ts index 670a5a07f..23ea16c97 100644 --- a/src/gtm/index.ts +++ b/src/gtm/index.ts @@ -64,7 +64,11 @@ export const sendWalletEvent = ( } }); -export const sendGTMPath = (from: string | undefined, to: string) => +export const sendGTMPath = ( + from: string | undefined, + to: string, + darkMode: boolean = false +) => sendGTM({ event: "VP " + to, page: { @@ -72,5 +76,6 @@ export const sendGTMPath = (from: string | undefined, to: string) => to_path: to }, user_properties: undefined, - ga_event: undefined + ga_event: undefined, + theme: darkMode ? "Dark" : "Light" }); diff --git a/src/router/index.ts b/src/router/index.ts index db02b6e10..5e06c2a3c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -26,6 +26,7 @@ import WithdrawRewards from "@/components/rewards/WithdrawRewards.vue"; import LimitOrderTable from "@/components/swap/LimitOrderTable.vue"; import VoteLegacy from "@/components/vote/VoteLegacy.vue"; import { sendGTMPath } from "@/gtm"; +import { vxm } from "@/store"; Vue.use(Router); @@ -354,7 +355,7 @@ const setPreferredService = (service: string) => { router.beforeEach((to, from, next) => { if (from.path !== to.path) { - sendGTMPath(from.path, to.path); + sendGTMPath(from.path, to.path, vxm.general.darkMode); } if (to.meta && to.meta.feature) { const service = services.find( diff --git a/src/store/modules/wallet/ethWallet.ts b/src/store/modules/wallet/ethWallet.ts index 7d2bcf9af..65e06ffab 100644 --- a/src/store/modules/wallet/ethWallet.ts +++ b/src/store/modules/wallet/ethWallet.ts @@ -79,18 +79,19 @@ export class EthereumModule extends VuexModule.With({ } @action async nativeBalanceChange(nativeBalance: string) { - vxm.ethBancor.updateUserBalances([ - { balance: fromWei(nativeBalance), id: ethReserveAddress } - ]); + if (nativeBalance) + vxm.ethBancor.updateUserBalances([ + { balance: fromWei(nativeBalance), id: ethReserveAddress } + ]); } @action async checkAlreadySignedIn() { const previouslySelectedWallet = localStorage.getItem(selectedWeb3Wallet); - googleTagManager(vxm.wallet.currentUser, previouslySelectedWallet); if (previouslySelectedWallet) { await onboard.walletSelect(previouslySelectedWallet); } + googleTagManager(this.loggedInAccount, previouslySelectedWallet); } @action async getBalance({ From a9d1b57db7eda99c17ee5755778f6148f1f9d631 Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 19:43:08 +0300 Subject: [PATCH 19/20] Changed wallet category name --- src/store/modules/wallet/ethWallet.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/modules/wallet/ethWallet.ts b/src/store/modules/wallet/ethWallet.ts index 65e06ffab..0daabaa00 100644 --- a/src/store/modules/wallet/ethWallet.ts +++ b/src/store/modules/wallet/ethWallet.ts @@ -59,16 +59,16 @@ export class EthereumModule extends VuexModule.With({ @action async connect() { try { - sendGTMEvent("Wallet Connect Select a Wallet Popup", "Wallet Connect"); + sendGTMEvent("Wallet Connect Select a Wallet Popup", "Wallet"); await onboard.walletSelect(); const state = onboard.getState(); - sendGTMEvent("Wallet Connect Wallet Icon Click", "Wallet Connect", { + sendGTMEvent("Wallet Connect Wallet Icon Click", "Wallet", { wallet_name: state.wallet.name }); await onboard.walletCheck(); sendWalletEvent( "Wallet Connect", - "Wallet Connect", + "Wallet", state.address, state.wallet.name ?? "" ); From ea2ca8efdb2221a80f70c83a8693fc33ef35b071 Mon Sep 17 00:00:00 2001 From: Ran Cohen Date: Wed, 5 May 2021 20:11:23 +0300 Subject: [PATCH 20/20] changed theme location --- src/gtm/index.ts | 6 +++--- src/store/modules/wallet/ethWallet.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gtm/index.ts b/src/gtm/index.ts index 23ea16c97..e808dcfe3 100644 --- a/src/gtm/index.ts +++ b/src/gtm/index.ts @@ -73,9 +73,9 @@ export const sendGTMPath = ( event: "VP " + to, page: { from_path: from, - to_path: to + to_path: to, + theme: darkMode ? "Dark" : "Light" }, user_properties: undefined, - ga_event: undefined, - theme: darkMode ? "Dark" : "Light" + ga_event: undefined }); diff --git a/src/store/modules/wallet/ethWallet.ts b/src/store/modules/wallet/ethWallet.ts index 0daabaa00..d89022d87 100644 --- a/src/store/modules/wallet/ethWallet.ts +++ b/src/store/modules/wallet/ethWallet.ts @@ -59,7 +59,7 @@ export class EthereumModule extends VuexModule.With({ @action async connect() { try { - sendGTMEvent("Wallet Connect Select a Wallet Popup", "Wallet"); + sendGTMEvent("Wallet Connect Select Wallet Popup", "Wallet"); await onboard.walletSelect(); const state = onboard.getState(); sendGTMEvent("Wallet Connect Wallet Icon Click", "Wallet", {