0
我对GTM世界有点新鲜感,当前的JavaScript存在于我接管项目之前。我的问题是广告系列代码不像他们应该解码(例如,更新%2aqwer)。我正在尝试添加encodingURL来尝试清理它,但是我遇到问题需要解决。GTM URL解码
function() {
try {
if ({{redirectParams}}){
var redirectParams = {{redirectParams}},
url = {{Page URL}},
utm_campaign = redirectParams.utm_campaign;
if (url.indexOf('utm_campaign') === -1 && url.indexOf('utm_source') === -1 && url.indexOf('utm_medium') === -1 && url.indexOf('utm_content') === -1 && url.indexOf('utm_term') === -1 && url.indexOf('gclid') === -1 && url.indexOf('dclid') === -1) {
return utm_campaign
}
我想我应该能够在decodeURIcomponent添加到“返回utm_campaign”语法,但它不工作。
我想我可以将它添加到“return utm_camapin”语法中,但事实并非如此。 (例如,返回decodeURIcomponent('utm_campaign)
很抱歉,但你的代码是没有意义的我。你能解释一下它远一点呢?utm_campaign = redirectParams。 utm_ca mpaign;不是很有用,因为你的例子中没有定义utm_campaign。 – michaelsinner