[x] the useEffect hook will be valuable on this page because you can log events on initial load with it: https://react.dev/
reference/react/useEffect
[x] page url: /
[x] user id: The user agent you log
Notes
You need 3 different loggers - one for development (local environments), one for staging (preview environments), and one for production (real life environments :0)
use the URL to determine which logger to use. For example:
if (window.location.href.includes("localhost")){
developmentLogger.logClickEvent({...})
} else if (window.location.href.includes("angels-among-us.netlify.app")){
stagingLogger.logClickEvent({...})
} else if (window.location.href.includes("fosters.angelsrescue.org")){
productionLogger.logClickEvent({...})
}
To initialize and authenticate the Analtyics logger (you'll obviously need to import the necessary classes/enums):
// development logger initialization example
AnalyticsLogger developmentLogger = new AnalyticsLogger({environment: EventEnvironment.DEVELOPMENT});
developmentLogger.authenticate(process.env.PUBLIC_NEXT_BOG_ANALYTICS_CLIENT_API_KEY);
Overview
We are going to track events in Angels among us as a trial run for our new Bog Analytics tool : )
Be sure to create a new branch before working on your ticket!!
Acceptance Criteria
Setup:
Events:
dog_{dog name}
filter_{filter name}
useEffect
hook will be valuable on this page because you can log events on initial load with it: https://react.dev/ reference/react/useEffect/
Notes