소스 검색

fix: ad block disabled tracking would block ga then can not pay (#1741)

tags/0.3.34
Joel 1 년 전
부모
커밋
dfd3f507fb
No account linked to committer's email address
2개의 변경된 파일3개의 추가작업 그리고 16개의 파일을 삭제
  1. 2
    12
      web/app/components/billing/pricing/plan-item.tsx
  2. 1
    4
      web/app/components/billing/upgrade-btn/index.tsx

+ 2
- 12
web/app/components/billing/pricing/plan-item.tsx 파일 보기

@@ -141,18 +141,8 @@ const PlanItem: FC<Props> = ({
setLoading(true)
try {
const res = await fetchSubscriptionUrls(plan, isYear ? 'year' : 'month')
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
}
// Adb Block additional tracking block the gtag, so we need to redirect directly
window.location.href = res.url
}
finally {
setLoading(false)

+ 1
- 4
web/app/components/billing/upgrade-btn/index.tsx 파일 보기

@@ -51,15 +51,12 @@ const UpgradeBtn: FC<Props> = ({
(setShowPricingModal as any)()
}
const onClick = () => {
handleClick()
if (loc && (window as any).gtag) {
(window as any).gtag('event', 'click_upgrade_btn', {
loc,
event_callback: handleClick,
})
}
else {
handleClick()
}
}

if (isPlain)

Loading…
취소
저장