hzdg / hz-core

HZ's internal library of React Components 🚧

Home Page:https://hz-core.netlify.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unique Anon ID generator

jesiah-hackinglife opened this issue · comments

A component for Analytics that generates a unique cookie and sends it to a data layer

-Set a unique cookie id:
Version 1.0:
-For desktop/android browsers use the browser-created client id: https://developer.mozilla.org/en-US/docs/Web/API/Client/id
-For iOS Safari users use Advertising ID (can be reset by user, but that isn't a common action) https://stackoverflow.com/questions/25502089/how-to-get-advertising-identifier-on-ios

Version 2.0:
-Push this ID into a table, ideally BigQuery or somewhere that has a native transfer to BigQuery
-Optionally, it would be great to update that table with the number of unique hits/sessions from that ID or the initial timestamp of the first load
-Push the ID into the data layer as a variable (can name "anonid" or something similar)
-Once we get to this step, I can provide exact syntax (edited)

Do they have a preference on how we should name that cookie @jesiah-hackinglife ?

@aamorozov nope something like hz-anon-id