I am looking for a way to attach additional URL parameters to any links that contain example.com on a webpage.
The current script I have only works if the link does not already have parameters attached to it.
<script>
document.body.innerHTML = document.body.innerHTML.replace('example.com', 'example.com?utm_day=monday);
</script>
What I really need is a solution that can identify and append any link with example.com, regardless of the existing parameters in the link. For instance, the script should be able to detect
<a href="https://example.com?formID=1234">
and add
<a href="https://example.com?formID=1234&utm_day=monday">
If you have any suggestions on how to achieve this, please let me know!