(function() { var themeName = 'newTestTheme', themeQueryParam = { _ab: 0, _fd: 0, _sc: 1, preview_theme_id: 122125320307 }; // add theme details above var updateQueryStringParameter = function(uri, key, value) { var re = new RegExp("([?&])" + key + "=.*?(&|#|$)", "i"); if( value === undefined ) { if (uri.match(re)) {return uri.replace(re, '$1$2');} else {return uri;} } else { if (uri.match(re)) {return uri.replace(re, '$1' + key + "=" + value + '$2'); } else { var hash = ''; if( uri.indexOf('#') !== -1 ){hash = uri.replace(/.*#/, '#');uri = uri.replace(/#.*/, '');} var separator = uri.indexOf('?') !== -1 ? "&" : "?"; return uri + separator + key + "=" + value + hash; } } }; var themeUrl = window.location.href; for (var key in themeQueryParam) { themeUrl = updateQueryStringParameter(themeUrl, key, themeQueryParam[key]); } if (!(sessionStorage.getItem(themeName) == 'true')) { //convert.redirect(themeUrl); window.location.href = themeUrl; } })();