if (window.mics && window.mics._call) { const userEventTag = {"site_id":"2417","enable_experimental_features":false,"enable_local_segment_evaluation":false,"enable_installation_id_generation":false,"enable_tcf_v2_for_cookie_matching":false,"enable_goo_matching":true,"enable_apx_matching":true,"enable_id5_id":false,"enable_utiq_mtid":false,"custom_configuration":{}} ; const mumConf = {"channel_id":"2417","active":true}; const cmp_ids = [69,352,408,308,5,247,379,10,385,384,340,404,185,417,436,25,14,125,421,46,416,316,321,376,348,84,353,397,280,61,221,396,411,428,312,292,6,380,302,260,392,297,424,407,429,21,165,28,38,92,229,361,435,329,224,317,388,141,420,403,9,225,77,212,96,393,129,371,134,105,2,311,343,237,412,425,430,264,279,423,44,291,59,413,259,27,391,335,236,181,350,382,54,406,113,419,76,7,318,434,303,387,323,213,198,330,345,367,399,306,299,3,438,431,167,35,426,162,374,112,123,355,63,18,282,414,327,409,310,50,31,72,386,231,363,218,104,319,304,258,351,390,401,171,418,58,433,383,287,235,246,300,432,410,168,405,183,422,273,305,242,294,341,79,437,415,332,427,47,200,68,369,90,227,354,309,222,364]; const enable_mum_id = JSON.parse(mumConf.active ?? userEventTag.enable_mum_id ?? true); const enable_id5 = JSON.parse(userEventTag.enable_id5_id ?? false); // Restrict from using forbidden registry mics._call("fd-darty17", "addAllowedRegistry", ['0']); if (enable_id5) { mics._call("fd-darty17", "addAllowedRegistry", ['4']); } const extra_allowed_registries = []; extra_allowed_registries.forEach(registry => mics._call("fd-darty17", "addAllowedRegistry", [registry])); const fullLegacyConf = { ...(userEventTag.custom_configuration || {}), "cmp_ids": cmp_ids, "enable_local_segment_evaluation": JSON.parse(userEventTag.enable_local_segment_evaluation ?? 'false'), "segment_evaluator_uri": userEventTag.segment_evaluator_uri, "segment_definition_uri": userEventTag.segment_definition_uri, "enable_apx_matching": enable_mum_id && JSON.parse(userEventTag.enable_apx_matching ?? 'true'), "enable_goo_matching": enable_mum_id && JSON.parse(userEventTag.enable_goo_matching ?? 'true'), "enable_tcf_v2_for_cookie_matching": JSON.parse(userEventTag.enable_tcf_v2_for_cookie_matching ?? 'false'), "enable_mum_id": enable_mum_id, "enable_id5": enable_id5, "namespace": userEventTag.namespace, "site_token": userEventTag.site_token ?? (!userEventTag.dat_token ? "fd-darty17" : undefined), "dat_token": userEventTag.dat_token ?? (!userEventTag.site_token ? "fd-darty17" : undefined), "device_id_registry_token_to_id_map": userEventTag.device_id_registry_token_to_id_map ?? {}, }; mics._call("fd-darty17", 'setConfig', [fullLegacyConf]); const mumIdConf = {"channel_id":"2417","active":true}; if (JSON.parse(mumIdConf.active ?? 'true')) { mics._call("fd-darty17", "addAllowedRegistry", ["mum"]); } else { mics._call("fd-darty17", "deleteAdvertisingCookie", ["vid"]); } const installationIdConfiguration = {"channel_id":"2417","device_id_registry_id":null,"device_id_registry_token":null,"active":false} ; if (installationIdConfiguration.device_id_registry_token) { if (JSON.parse(installationIdConfiguration.active ?? 'false')) { mics._call("fd-darty17", "addAllowedRegistry", [installationIdConfiguration.device_id_registry_token]); mics._call( "fd-darty17", 'upsertAdvertisingCookie', ["ins", installationIdConfiguration.device_id_registry_token, "aNmZkZDNkNTctMzJmZS00OTNjLWIyMjYtZDJmNDQ5NGQ0YjUw"] ); } else { mics._call("fd-darty17", "deleteAdvertisingCookie", [installationIdConfiguration.device_id_registry_token]); } } const firstIdConf = {"channel_id":"2417","active":false}; if (JSON.parse(firstIdConf.active ?? 'false')) { mics._call("fd-darty17", "addAllowedRegistry", ['first-id']); function readCookie(name) { const cookies = window.document.cookie.split(';'); for (let i = 0; i < cookies.length; i++) { const cookie = cookies[i].replace(/ /g, '').split('='); if (cookie[0] === name) { return cookie[1]; } } return undefined; } let firstIdValue; if (window.FIRSTID !== undefined && window.FIRSTID.getId !== undefined) { window.mics._call("fd-darty17", "lodDebug", ['FIRSTID present, use FIRSTID.getId()']); firstIdValue = window.FIRSTID.getId(); } else if (window.firstId !== undefined && window.firstId.cookieName !== undefined) { window.mics._call("fd-darty17", "lodDebug", ['only firstId conf present, use firstId.cookieName']); firstIdValue = readCookie(window.firstId.cookieName); } else { window.mics._call("fd-darty17", "lodDebug", ['Nothing found, read cookie firstid']); firstIdValue = readCookie("firstid"); } window.mics._call("fd-darty17", "lodDebug", ['firstIdValue = ' + firstIdValue]); if (firstIdValue) { window.mics._call("fd-darty17", "_addIdentifier", ['USER_AGENT', {"$user_agent_id": `net:first-id:${firstIdValue}`}]); } } let utiqMtidConf = {"channel_id":"2417","active":false,"compartment_id":"20","compartment_token":"utiq-martechpass"}; if (JSON.parse(utiqMtidConf.active ?? 'false')) { function addUtiqIdentifier(mtid) { const expirationDate = JSON.parse(localStorage.utiqPass ?? "{}")?.ids?.source?.connectId?.ttl; let account = { "$compartment_token": utiqMtidConf.compartment_token, "$user_account_id": mtid }; if (expirationDate) { account.$expiration_ts = Date.parse(expirationDate); } window.mics._call("fd-darty17", "_addIdentifier", ['USER_ACCOUNT', account]); } let utiqFetchingIntervalId; function checkForUtiq() { if (window.Utiq && window.Utiq.API) { addUtiqIdentifier(window.Utiq.API.getIdGraphEntry('mtid')); clearInterval(utiqFetchingIntervalId); } } utiqFetchingIntervalId = setInterval(checkForUtiq, 500); setTimeout(() => { clearInterval(utiqFetchingIntervalId); }, 30000); }; mics._call("fd-darty17", 'markConfigAsLoaded', []); }