Anyone set the ajs_anonymous_id
in SSR (Next.js) if it doesn't currently exist on client?
I have a need to "read" the ajs_anonymous_id
(Segment analytics) cookie during a SSR rendering in Next.Js, but of course there are instances when that cookie does not exist yet ie...person hasn't visited my site before and thus never go it... BUT, since i need in SSR side..... I was hoping there is a process I can "set it" on the server side so that I can use it, THEN have it on the client too... so..
Client visits page
Has ajs_anonymous_id
cookie, cool, use it and do some display things....
Does not have ajs_anonymous_id
, I seed the ajs_anonymous_id
(drop a cookie) and then do some display things.
Pages loads.. My analytics file (that loads on the font end thru a containe) sees there is an already ajs_anonymous_id
cookie, cool.
Anyone have an example of this or how to achieve it?