taho.xyz icon indicating copy to clipboard operation
taho.xyz copied to clipboard

Creates UUID, puts into local and sends event to posthog

Open zuuring opened this issue 2 years ago • 3 comments

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 entry UUID.

  • Sends Download page visited event to posthog

  • Checks if UUID already present and if not, creates UUID and puts in storage

Testing

  • [ ] Visit (https://deploy-preview-113--tally-cash.netlify.app/download/) to generate a UUID
  • [ ] Check via developer tools Application > Storage > Cookies > if UUID is present
  • [ ] Confirm event saved in Posthog https://app.posthog.com/events

zuuring avatar Oct 17 '22 10:10 zuuring

@zuuring any chance we can do this all localStorage and skip the cookie? What's the downside?

mhluongo avatar Oct 19 '22 15:10 mhluongo

We need further project clarifications before this will deploy ready.

greg-nagy avatar Oct 19 '22 18:10 greg-nagy

@zuuring any chance we can do this all localStorage and skip the cookie? What's the downside?

@mhluongo We looked into this and using localStorage on the extension side will require us to enable storage permissions which will flag a permission modal when installing the extension.

zuuring avatar Oct 20 '22 07:10 zuuring