Skip to content

Commit f6894de

Browse files
authored
Merge pull request #1443 from scroll-tech/scr-event-tracking
ga: track scr related events
2 parents f0a7451 + 6a4f0dc commit f6894de

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

src/app/SCR-sSCR/Header/GetSCRDialog.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use client"
22

3+
import { Fragment } from "react"
4+
35
import { Box, Dialog, DialogContent, DialogTitle, Divider, IconButton, SvgIcon, Typography, alpha } from "@mui/material"
46

57
import CloseSvg from "@/assets/svgs/bridge/close.svg"
@@ -85,7 +87,7 @@ const GetSCRDialog = props => {
8587
circumstances will we be responsible for any losses you may incur.
8688
</Typography>
8789
{GER_SCR_DATA.map(({ title, data }, index) => (
88-
<>
90+
<Fragment key={title}>
8991
{!!index && <Divider sx={{ my: ["2.4rem", "3.2rem"], borderColor: "#E9E9E9" }}></Divider>}
9092
<Box key={title}>
9193
<Typography sx={{ fontSize: ["1.6rem", "1.8rem"], lineHeight: "2.4rem", fontWeight: 600 }}>{title}</Typography>
@@ -95,7 +97,7 @@ const GetSCRDialog = props => {
9597
))}
9698
</Box>
9799
</Box>
98-
</>
100+
</Fragment>
99101
))}
100102
</DialogContent>
101103
</Dialog>

src/app/SCR-sSCR/Header/GetSCRItem.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sendGAEvent } from "@next/third-parties/google"
12
import Image from "next/image"
23

34
import { Button, Stack, Typography } from "@mui/material"
@@ -6,6 +7,13 @@ import ArrowSvg from "@/assets/svgs/ecosystem/arrow.svg"
67

78
const GetSCRItem = props => {
89
const { name, logoURL, href } = props
10+
11+
const handleEventTracking = () => {
12+
sendGAEvent("event", "click_get_SCR_link", {
13+
label: name,
14+
link: href,
15+
})
16+
}
917
return (
1018
<Stack sx={{ mt: ["2.4rem", "3.2rem"] }} direction="row" justifyContent="space-between" alignItems="center">
1119
<Stack direction="row" spacing="1.6rem" alignItems="center">
@@ -22,6 +30,7 @@ const GetSCRItem = props => {
2230
fontWeight: 600,
2331
}}
2432
target="_blank"
33+
onClick={handleEventTracking}
2534
>
2635
Visit <ArrowSvg className="ml-[8px]"></ArrowSvg>
2736
</Button>

src/app/SCR-sSCR/Header/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client"
22

3+
import { sendGAEvent } from "@next/third-parties/google"
34
import Image from "next/image"
45
import { useEffect, useState } from "react"
56

@@ -38,12 +39,18 @@ const Header = props => {
3839
values: [circulatingSupply, votableSupply],
3940
action: () => {
4041
setGetSCROpen(true)
42+
sendGAEvent("event", "click_get_SCR", {
43+
label: "Get SCR now",
44+
})
4145
},
4246
},
4347
{
4448
id: "stake-scr",
4549
action: () => {
4650
// TODO: coming soon
51+
// sendGAEvent("event", "click_stack_SCR", {
52+
// label: "Stack SCR now",
53+
// })
4754
},
4855
},
4956
]

src/app/scrETH/Header/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client"
22

3+
// import { sendGAEvent } from "@next/third-parties/google"
34
import Image from "next/image"
45
import { useEffect, useState } from "react"
56

@@ -25,6 +26,13 @@ const Header = () => {
2526
window.removeEventListener("resize", handleResize)
2627
}
2728
}, [])
29+
30+
// TODO:coming soon
31+
// const handleEventTracking = () => {
32+
// sendGAEvent("event", "click_get_ethSCR", {
33+
// label: "",
34+
// })
35+
// }
2836
return (
2937
<Container
3038
sx={{

src/theme/light.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const lightTheme = {
138138
"&:hover": {
139139
color: paletteOptions.primary.main,
140140
backgroundColor: paletteOptions.background.default,
141+
borderColor: paletteOptions.primary.main,
141142
},
142143
},
143144
},

0 commit comments

Comments
 (0)