If someone clicks from our website e.g. https://tallyfy.com to our product i.e. https://go.tallyfy.com - we wish to automatically add UTM parameters to track the source of the signup within the URL, via the referrer value in the request. Ideally, the URL then served to the user would be something like this:
In this case, utm_term would be the portion of the URL in the referrer from the root domain i.e. in this case https://tallyfy.com/definition-client-onboarding would be where they clicked before they arrived at the signup page.
How would I implement this automation of utm_tag additions via a Cloudflare worker? Any sample code?