sed 's|$|SUFFIX|' appends to every line. The operation is trivial; deciding what to append is where it gets interesting, particularly with URLs.
The query-string branch
Appending ?utm_source=x is correct only if the URL has no query string already. If it does, the correct separator is &, and a blind append produces a URL with two ? characters. Most servers parse that as a single parameter with a literal ? inside its value, which means the tracking silently does not work rather than visibly failing.
Anything appending tracking parameters at scale needs to branch on whether ? is already present. A flat append does not.
Fragments come last
#section must remain the final component of a URL. Append a query string to a URL that already ends in a fragment and the parameters end up inside the fragment, where the server never sees them at all.
The safe sequencing
Strip query strings, append the known-good parameter set, then reattach fragments if you need them. Three deterministic passes beat one clever regex that handles the common case and mangles the rest.
Try it: Add Suffix on SeoWolf's Notepad.