Overriding webPage context PageViewID in javascript tracker

We generate our own UUID for each Pageview, and although I know we could pass this as a custom context, is it possible to override the WebPage context’s pageViewID with our own to avoid storing a separate field? I’ve dug through the JS and it’s not clear if/how it would be possible without modifying the JS tracker code, as the pageViewID seems to be stored as internal state.

Does anyone have any suggestion on how to do this without modifying the JS tracker or using a custom context? Thanks!

Hey @Kennon_Ballou,

You can’t override the JS tracker’s in-built method for page view ids.

You could, however, just not turn it on, and send your own UUID against the web page context schema if you wanted, which would have the same effect as overriding the method. Global contexts would probably be helpful in doing so.

However, if it were me, I would choose to leave the standard page view ID switched on, and attach a separate custom context for your own one - this way you’d have an audit path which would make life far easier if you ended up in a scenario where something looks fishy, and you need to figure out why.

Best,

2 Likes

Thanks for the tip!