var utm = 'utm_term' var number = (window.location.toString().substr(window.location.toString().indexOf(utm + '=') + utm.length + 1, 50)).toLowerCase(); With the help of UTM-tag I pull out the value. If it is encoded, for example, this way:
%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C+%D0%B0%D0%B9%D1%84%D0%BE%D0%BD+6s I can not decode it with the decodeURI(str) method.
I can decode this way:
decodeURI('%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C+%D0%B0%D0%B9%D1%84%D0%BE%D0%BD+6s') That is, directly, but if you try decodeURI(number) , then nothing happens.