msrougi

Javascript para repassar parâmetros UTM

Apr 26th, 2021
637
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. document.addEventListener("DOMContentLoaded", function(){
  2.    var url_ = location.href;
  3.    var params = url_.substring(url_.indexOf("?"));
  4.  
  5.    if(~params.indexOf("?utm")){
  6.       var as = document.querySelectorAll("a");
  7.       for(var x=0; x<as.length; x++){
  8.          as[x].href = as[x].href+params;
  9.       }  
  10.    }
  11. });
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×