javascript Paysafe:查询字符串抓取器(仅限白名单)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript Paysafe:查询字符串抓取器(仅限白名单)相关的知识,希望对你有一定的参考价值。

/*
Notes:
- Insert within normal BK code (before BKTAG.doTag(ENTER CONTAINER ID HERE, 4); function)
- Update 'qsp_whitelist' array to include any query-string params you want (logic will match any params begining with your value, e.g. 'utm_campaign' would match 'utm_' in whitelist)
*/

// whitelist params ("starts with") (add more params to this list)
	qsp_whitelist = ["utm_"];


// Grab Query-String Parameters // grab from urlP["nameofparameter"], e.g. urlP["email_id"]
	var urlP;
	var match,
		pl = /\+/g, // Regex for replacing addition symbol with a space
		search = /([^&=]+)=?([^&]*)/g,
		decode = function(s) {
			return decodeURIComponent(s.replace(pl, " "));
		},
		query = window.location.search.substring(1);

	urlP = {};
	while (match = search.exec(query))
		urlP[decode(match[1]).toLowerCase()] = decode(match[2]);

	// query-string param grabber
	for (qsp in urlP){

		for (var i = 0; i < qsp_whitelist.length; i++) {
			
			if (qsp.indexOf(qsp_whitelist[i]) === 0){
				
				bk_addPageCtx('qsp_' + qsp, urlP[qsp]);

			}
		}

	}

以上是关于javascript Paysafe:查询字符串抓取器(仅限白名单)的主要内容,如果未能解决你的问题,请参考以下文章

如何在 ruby​​ on rails 中使用 paysafe 支付解决方案? [关闭]

html Paysafe:BlueKai CoreTag:GTM建议代码

python Paysafe:ET到DMP:用户数据API模板

javascript 使用JavaScript获取查询字符串参数

JavaScript 查询字符串 [关闭]

JavaScript 查询字符串 [关闭]