hzdg / hz-core

HZ's internal library of React Components 🚧
https://hz-core.netlify.com
0 stars 0 forks source link

Unique Anon ID generator #19

Open jesiah-hackinglife opened 5 years ago

jesiah-hackinglife commented 5 years ago

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)

aamorozov commented 5 years ago

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

jesiah-hackinglife commented 5 years ago

@aamorozov nope something like hz-anon-id