-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creates UUID, puts into local and sends event to posthog #113
base: main
Are you sure you want to change the base?
Conversation
- This adds the basic functionality to generate a new UUID the first time the user visits the /download/ page which is then put both as a `cookie + localStorage` key entry `UUID`. - Sends `Download page visited` event to posthog - Checks if UUID already present and if not, creates UUID and puts in storage
- Added cookie expiry date to see if it resolves issue causing cookie to not be read across website -> extension
GATSBY_DISCORD_APP_ID="1008427467918295044" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This env variable does not seem to be in use
@@ -56,7 +56,8 @@ | |||
"react-helmet": "^6.1.0", | |||
"react-query": "^3.39.1", | |||
"siwe": "^1.1.6", | |||
"ulid": "^2.3.0" | |||
"ulid": "^2.3.0", | |||
"uuid": "^9.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might consider using the ulid
library here instead of importing a new uuid
library. Not a blocker.
Accept: "application/json", | ||
}, | ||
}) | ||
// eslint-disable-next-line no-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
}, | ||
}) | ||
// eslint-disable-next-line no-console | ||
console.log("UUID:", retrievedUUID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need a console.log here
@zuuring any chance we can do this all |
We need further project clarifications before this will deploy ready. |
How to use
Import the Posthog event
import { posthogEvent } from "shared/analytics/posthog";
Call the function where you need events to fire
posthogEvent("Insert your posthog event title here")
Notes
This adds the basic functionality to generate a new UUID the first time the user visits the /download/ page which is then put both as a
cookie + localStorage
key entryUUID
.Sends
Download page visited
event to posthogChecks if UUID already present and if not, creates UUID and puts in storage
Testing
(https://deploy-preview-113--tally-cash.netlify.app/download/)
to generate a UUIDApplication > Storage > Cookies >
ifUUID
is presenthttps://app.posthog.com/events