feat: use gtag instead gtm (#1695)
This commit is contained in:
parent
b5dd948e56
commit
2e588ae221
12 changed files with 64 additions and 34 deletions
|
|
@ -141,8 +141,18 @@ const PlanItem: FC<Props> = ({
|
|||
setLoading(true)
|
||||
try {
|
||||
const res = await fetchSubscriptionUrls(plan, isYear ? 'year' : 'month')
|
||||
|
||||
window.location.href = res.url
|
||||
if ((window as any).gtag) {
|
||||
(window as any).gtag('event', 'click_pay_btn', {
|
||||
plan,
|
||||
interval: isYear ? 'year' : 'month',
|
||||
event_callback: () => {
|
||||
window.location.href = res.url
|
||||
},
|
||||
})
|
||||
}
|
||||
else {
|
||||
window.location.href = res.url
|
||||
}
|
||||
}
|
||||
finally {
|
||||
setLoading(false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue