Skip to content

sdirosa/ObjectivTrackerActivationExample

Repository files navigation

ObjectivTrackerActivationExample

  • main.tsx

    • The ReactTracker is active when getCookieConsentValue() from react-cookie-consent returns 'true'
    • Configured ObjectivProvider to not track ApplicationLoaded event via its options
  • App.tsx

    • Added a new CookieBanner component to the JSX output
  • CookieBanner.tsx

    • This component is a wrapper around the CookieConsent component from react-cookie-consent
    • We get the tracker instance via the useTracker hook
    • And create a trackApplicationLoadedEvent callback using the useApplicationLoadedEventTracker hook
    • Finally we pass a custom onAccept handler to the CookieConsent component, to invoke setActive(boolean) of the tracker and trigger the ApplicationLoadedEvent.

About

Example of how to activate ReactTracker via a callback of a Cookie Banner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published