snowplow / snowplow-javascript-tracker

Snowplow event tracker for client-side and server-side JavaScript. Add analytics to your websites, web apps and servers.
http://snowplowanalytics.com
BSD 3-Clause "New" or "Revised" License
550 stars 222 forks source link

gaCookies using potentially fragile mechanism #578

Open shermozle opened 7 years ago

shermozle commented 7 years ago

gaCookies just takes the entire Google Analytics cookie out and plugs it into a context.

GA provides a method and callback to do this properly. We should probably use this. Possibly keep both for backwards compatibility? This probably makes the modelling stage a bit easier too since there's more than just the client ID in there.

alexanderdean commented 7 years ago

Changing this would introduce a dependency on the Google Analytics tracker though - is that what we want? What if somebody has switched off GA but still wants to track the cookie...

shermozle commented 7 years ago

Good point. Perhaps a mechanism to push a custom value in and point to that GA article in docs?

The point Google make is that you can't rely on the cookie being there. Perhaps gaCookies could be generalised to a "grab all this list of cookies" so it could pull in other first-party cookies too?