This script helps to is a small and simples solution to propagate utm params in a url for every link in a page. It is useful when you want to track the source of the traffic in your website. The solution includes the use of a cookie to store the utm for 24hours and also contemplate the solution for dynamic urls in SPA applications.
Add the minified version of the script in the
of your page.<script src="./utm-propagator.min.js"></script>
The script will check if there is any utm params in the url, if so, it will store the utm params in a cookie for 24 hours. Then it will propagate the utm params to every internal link in the page.
This script was created by Ricardo Ribeiro