({ id, email, experienceLevel })
| 18 | }: PixelsContextProviderProps): ReactElement { |
| 19 | const context: PixelsContextData = { |
| 20 | trackSignup({ id, email, experienceLevel }) { |
| 21 | const urlParams = new URLSearchParams(window.location.search); |
| 22 | const isExtension = urlParams.get('ref') === 'install'; |
| 23 | |
| 24 | const isEngineer = |
| 25 | !!experienceLevel && experienceLevel !== 'NOT_ENGINEER'; |
| 26 | if (typeof globalThis.gtag === 'function') { |
| 27 | globalThis.gtag('event', 'signup'); |
| 28 | if (isEngineer) { |
| 29 | globalThis.gtag('event', 'engineer_signup'); |
| 30 | } |
| 31 | if (isExtension) { |
| 32 | globalThis.gtag('event', 'extension_signup'); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | if (typeof globalThis.fbq === 'function') { |
| 37 | globalThis.updateFbUserData(id, email); |
| 38 | globalThis.fbq('track', 'signup'); |
| 39 | const seniority = EXPERIENCE_TO_SENIORITY[experienceLevel]; |
| 40 | if (seniority) { |
| 41 | globalThis.fbq('track', `signup3_${seniority}`); |
| 42 | } |
| 43 | if (isEngineer) { |
| 44 | globalThis.fbq('track', 'engineer signup'); |
| 45 | } |
| 46 | if (isExtension) { |
| 47 | globalThis.fbq('track', 'extension_signup'); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | if (typeof globalThis.twq === 'function') { |
| 52 | globalThis.twq('event', 'tw-o6izs-okoq6', {}); |
| 53 | } |
| 54 | |
| 55 | if (typeof globalThis.rdt === 'function') { |
| 56 | globalThis.rdt('track', 'SignUp'); |
| 57 | } |
| 58 | |
| 59 | if (typeof globalThis.ttq?.track === 'function') { |
| 60 | globalThis.ttq.track('CompletePayment', { value: 1 }); |
| 61 | } |
| 62 | }, |
| 63 | trackPayment() { |
| 64 | // if (typeof globalThis.gtag === 'function') { |
| 65 | // globalThis.gtag('event', 'purchase', { |
nothing calls this directly
no test coverage detected