> For the complete documentation index, see [llms.txt](https://helper.docs.sirdata.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helper.docs.sirdata.net/english/sirdata-analytics-helper-1/cookieless-callback-function.md).

# Cookieless: callback function

f you use the cookieless option, the loading of Google Analytics is modified to allow manipulation of the user identifier: the *client\_Id* (GA4) or the *clientId* (UA).

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:

```javascript
{
    event: 'sdh_UUID_ready', //event name
    sdh_UUID: '1701630691.1681319441', //client_id or clientId
    sah_pa: '27421', //Partner Id
    sah_c: '71', //Config Id
    sah_consent: '0' //0 ou 1 : consent state for measurement purpose
}
```

{% hint style="danger" %}
The presence of an identifier and a consent value of 0 indicates that it is a ***cookieless identifier*** .

This identifier can be used for processing based on *legitimate interest*, but not processing based on consent.

**UNDER NO REASON** can it be stored in the user's terminal, in a cookie or in the local storage for example.
{% endhint %}

Here's how to set up your callback function:​

```javascript
<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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://helper.docs.sirdata.net/english/sirdata-analytics-helper-1/cookieless-callback-function.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
