anonymousTracking no page view ids

Hello,

Using js-2.18.2 with anonymousTracking: true, I expected domain session and session ids not to be set but I’m finding that page_view_id is also not set. Below image is of page_view events that do not have a page_view_id as well as session ids.

Screenshot 2024-10-11 at 16.14.26

Is this expected behaviour?

Thanks
Kyle

Can you share your initialisation snippet / a reproduction example by any chance? I’m mostly interested in what value stateStorageStrategy is. As far as I know even with anonymousTracking page view id should in theory still be tracked.

Hey Mike,

I do still have the setting in place:

discoverRootDomain: true,
cookieLifetime: 31536000,
anonymousTracking: true,
stateStorageStrategy: ‘cookieAndLocalStorage’,
cookieSameSite: ‘Lax’,
eventMethod: ‘beacon’,

I found anonymousTracking: true, does override stateStorageStrategy. Then on the next page_view I do not set anonymousTracking: true, in the initialization options.

I’m guessing i’m creating some kind of conflict with the initialization options above?

Thanks
Kyle

Hey Mike,

Weirdly in my dev SP environment and localhost I can’t replicate missing pv id on aforementioned initialization settings.

Would best practice just to use stateStorageStrategy: none over anonymousTracking?

Thanks
Kyle

Yeah - I wasn’t able to either. 2.18.2 is fairly old though, I suspect you may possibly have better success in a more recent version.

I think this depends on what you are trying to achieve. stateStorageStrategy is going to be quite useful if you don’t have consent to store any data on the users end device (as in ePrivacy directive / regulation). If you do however then and you are just trying to remove things that may be considered personal data then ideally you want some local state storage with anonymous tracking turned on.