<!--your preparation HTML code goes here-->
/*your preparation JavaScript code goes here
To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/
async function globalMeasureThatScriptPrepareFunction() {
// This function is optional, feel free to remove it.
// await someThing();
}
try {
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function () {
var consent_ga4 = Didomi.getUserConsentStatusForVendor('c:googleana-4TXnJigR');
window.dataLayer.push({
event : 'consent_ready',
consent: {
status: window.dataLayer.dl ? window.dataLayer.dl['consent.status.cd'] : undefined,
ga: consent_ga4 ? '1' : !consent_ga4 ? '0' : undefined,
time: (performance.now() / 1000).toFixed(1) + ' s',
vendor: {
adform: Didomi.getUserConsentStatusForVendor('50'),
echobox: Didomi.getUserConsentStatusForVendor('c:echobox'),
chartbeat: Didomi.getUserConsentStatusForVendor('c:chartbeat'),
clarity: Didomi.getUserConsentStatusForVendor('c:clarity'),
facebook: Didomi.getUserConsentStatusForVendor('facebook'),
ga: consent_ga4,
gfk: Didomi.getUserConsentStatusForVendor('758'),
google: Didomi.getUserConsentStatusForVendor('google'),
outbrain: Didomi.getUserConsentStatusForVendor('164')
}
}
});
});
} catch(e){}
(function() {
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function() {
try {
// Referencia local a Didomi para evitar búsquedas repetidas en el scope global
var didomi = window.Didomi;
var getConsent = didomi.getUserConsentStatusForVendor.bind(didomi);
// Obtener consentimiento GA4 una sola vez
var consent_ga4 = getConsent('c:googleana-4TXnJigR');
// Push directo al dataLayer con objeto preconfigurado
(window.dataLayer = window.dataLayer || []).push({
event: 'consent_ready',
consent: {
status: window.dataLayer.dl ? window.dataLayer.dl['consent.status.cd'] : undefined,
ga: consent_ga4 ? '1' : !consent_ga4 ? '0' : undefined,
time: (performance.now() / 1000).toFixed(1) + ' s',
vendor: {
adform: getConsent('50'),
echobox: getConsent('c:echobox'),
chartbeat: getConsent('c:chartbeat'),
clarity: getConsent('c:clarity'),
facebook: getConsent('facebook'),
ga: consent_ga4,
gfk: getConsent('758'),
google: getConsent('google'),
outbrain: getConsent('164')
}
}
});
} catch(e) {}
});
})();
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
actual | |
futuro |
This benchmark does not have any results yet. Be the first one to run it!