Get everything after the ? and add those other links. The only care you need to take is appending an ? or & before the params depending on if the links already have a query string.
var params = window.location.href.split('?')[1]
// get links somehow and then
links.forEach(function(link) {
var href = link.href
href += (href.indexOf('?') == -1) ? '?' : '&'
href += params
link.href = href
})