Use an established URL parser (I’ll say it again!)
It’s impossible to write a UTM parser without understanding how the wide world constructs (totally valid) URLs! The shorter the code, the more likely it misses tons of cases. So instead of some dude’s one- or two-liner, use a tested library. →