javascript Engie DGP - Allomedia BKUUID iframe抓取器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript Engie DGP - Allomedia BKUUID iframe抓取器相关的知识,希望对你有一定的参考价值。

/*
######################
### BKUUID GRABBER ###
######################
 
Author : roshan.gonsalkorale@oracle.com
 
Pre-requisites:

- BlueKai ID parent poster tag must be scheduled in BlueKai tag management in the UI (https://gist.github.com/roshanbluekai/e8e9bc2f1c3d860bc2ab2a44035567c5)

Instructions :
 
- This code must fire BEFORE the BlueKai CoreTag code snippet
- Will work in Tag Managers or directly on site
 
*/

// Declare Global Object
window.bluekai_service = window.bluekai_service || {};
bluekai_service.functions = bluekai_service.functions || {};
window.bluekai_service.bkuuid_caller = window.bluekai_service.bkuuid_caller || {};


// ### FUNCTIONS ###

// FUNCTION : Local Storage Retriever
bluekai_service.functions.localstorage_retriever = function(name_of_var) {

	if (typeof(Storage) !== "undefined") {

		var result = JSON.parse(localStorage.getItem(name_of_var));
		if (!result) {

			return [];
		}

		return result;
	}

};

// FUNCTION : Local Storage Sender 
bluekai_service.functions.localstorage_sender = function(data, name_of_var) {

	if (typeof(Storage) !== "undefined") {

		localStorage.setItem(name_of_var, JSON.stringify(data));

	} else {

		return "no storage"; // HTML 5 NOT SUPPORTED
	}

};

// FUNCTION : BKUUID Parent Receiver
bluekai_service.functions.bkuuid_parent_receiver = function(event) {

	if (event.origin.indexOf("tags.bluekai.com") > -1) {

		if (window.bluekai_service.bkuuid_caller.__bluekai_data_sent === false && typeof event.data !== 'undefined' && event.data.source === 'bluekai_obfus') {

			// RUN YOU CODE HERE!!!!
			bluekai_service.functions.localstorage_sender(event.data.bluekaiIds.bk_uuid, "BKUUID"); // Send to local storage							
			bluekai_service.functions.localstorage_sender(event.data.bluekaiIds.bk_uuid_obfs_56370, "BKUUID_56370"); // Send to local storage

			window.bluekai_service.bkuuid_caller.__bluekai_data_sent = true;

		}

	}

}

// ### EXECUTION ###  
window.bluekai_service.bkuuid_caller.__bluekai_data_sent = false;
addEventListener('message', window.bluekai_service.functions.bkuuid_parent_receiver, false);

以上是关于javascript Engie DGP - Allomedia BKUUID iframe抓取器的主要内容,如果未能解决你的问题,请参考以下文章

html Engie - A / B美味 - 网站优化标签

html Engie:iOS / Android App Pixel

html Engie ID_PERS查询字符串Grabber

DGP链游公会首发合作项目——D.G.Pals

DGP链游公会丨一文概览什么是GameFi链游

Hello World