Cookieless: callback function
If you use the cookieless option, the loading of Google Analytics is modified to allow manipulation of the user identifier: the client_id (GA4).
You and your partners can use the Helper's native tail handler to initiate an asynchronous callback function when the identifier is ready.
The callback function will receive this object model as an argument:
{
event: 'sdh_UUID_ready', //event name
sdh_UUID: '1701630691.1681319441', //client_id
sah_pa: '27421', //Partner Id
sah_c: '71', //Config Id
sah_consent: '0' //0 ou 1 : consent state for measurement purpose
}Here's how to set up your callback function:
<script>
var callback_function = function(data){
//Your code here, example below :
console.log(data);
if (data.sdh_UUID) {
console.log("le client_id est : " + data.sdh_UUID);
}
//End of demo code to be replaced
}
window.sd_gahq = window.sd_gahq || [];
window.sd_gahq.push(callback_function);
</script>If the identifier is ready, your callback function will be executed immediately, and if not, it will be as soon as the identifier has been loaded.
Mis à jour
