mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 18:45:58 +08:00
fix: ad block disabled tracking would block ga then can not pay (#1741)
This commit is contained in:
parent
d5695b3170
commit
dfd3f507fb
@ -141,18 +141,8 @@ const PlanItem: FC<Props> = ({
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
try {
|
try {
|
||||||
const res = await fetchSubscriptionUrls(plan, isYear ? 'year' : 'month')
|
const res = await fetchSubscriptionUrls(plan, isYear ? 'year' : 'month')
|
||||||
if ((window as any).gtag) {
|
// Adb Block additional tracking block the gtag, so we need to redirect directly
|
||||||
(window as any).gtag('event', 'click_pay_btn', {
|
|
||||||
plan,
|
|
||||||
interval: isYear ? 'year' : 'month',
|
|
||||||
event_callback: () => {
|
|
||||||
window.location.href = res.url
|
window.location.href = res.url
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
window.location.href = res.url
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
@ -51,15 +51,12 @@ const UpgradeBtn: FC<Props> = ({
|
|||||||
(setShowPricingModal as any)()
|
(setShowPricingModal as any)()
|
||||||
}
|
}
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
|
handleClick()
|
||||||
if (loc && (window as any).gtag) {
|
if (loc && (window as any).gtag) {
|
||||||
(window as any).gtag('event', 'click_upgrade_btn', {
|
(window as any).gtag('event', 'click_upgrade_btn', {
|
||||||
loc,
|
loc,
|
||||||
event_callback: handleClick,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
handleClick()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPlain)
|
if (isPlain)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user