Node.js tracker - set page URL on events (selfDescribing)

Hi all, I have a similar question to https://discourse.snowplow.io/t/net-tracker-set-page-url-on-events-possible/7839, but for the Node.js tracker.

I would like to have the page URL (along with the UTM params so that the campaign attribution parser can pick those up) set on self-describing events, for instance a submit_form event. What would be the best way to achieve that so that I can make the most out of the “standard” properties & campaign attribution enrichment?

Many thanks in advance!

1 Like

The buildSelfDescribingEvent function returns a PayloadBuilder; you can use the add("url", url) method to add the URL to the event before you pass the PayloadBuilder to track(); this is similar to how browser-tracker-core does it.

1 Like

Many thanks for this! That’s perfect, much appreciated!