snowplow-javascript-tracker icon indicating copy to clipboard operation
snowplow-javascript-tracker copied to clipboard

Capture page title for all type of web events

Open erakor opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. According to the Browser tracker documentation, pageviews and page pings "automatically captures the URL, referrer URL and page title (inferred from the <title> tag)." Why aren't other types of events also capturing the page title as part of the Page fields?

Describe the solution you'd like Add the page title (if available) with every type of event; not just Pageviews and Page pings.

Describe alternatives you've considered We add the page title to a "page" entity.

erakor avatar Apr 10 '25 16:04 erakor

Historically we've steered away from this for two main reasons

  1. It increases the size of the payload for each event that isn't a page view / page ping and as a result increases the overall request size (which in turn ends up costing more throughout the pipeline for processing and storage).
  2. Generally folks running data models (unified or others) will use the web page id context as the UUID for the page and then join any events to this rather than duplicate the data for each event. Given that the UUID only lasts for the length of the page view this still allows you to have dynamic titles rather than relying on a relationship between URL and page title for example.

That said it is possible to do this using something like a simple plugin for the JS tracker which uses the beforeTrack and setting the page parameter to your desired page title.

miike avatar Apr 11 '25 00:04 miike

@miike Makes sense. Thanks for the explanation!

erakor avatar Apr 12 '25 14:04 erakor