I'm playing around with a Squarespace Website and attempting to search for/get Query string Parameters. No matter what I try with code injection I get null, of course it works fine in the console but not when I use code injection, it is probably something very simple I'm missing, any help would be appreciated.
www.mysite.com?x=123
(function(){
var urlParams = new URLSearchParams(window.location.search);
console.log(urlParams.get('x'));
})();