> For the complete documentation index, see [llms.txt](https://docs.dfinery.ai/developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dfinery.ai/developer-guide/en/undefined-1/web/advanced-use-case/additional.md).

# Additional Settings

### OnInitialized function <a href="#oninitialized" id="oninitialized"></a>

* The OnInitialized function is used when the SDK has logic that needs to run after Init is complete.

```javascript
Dfinery.OnInitialized(() => {
  // init Operation logic after
});
```

* If there is page transition logic right after calling the event function, the page transition may occur before the function is completed, so the event may not be collected. Since logEvent is an asynchronous function that returns a Promise, it is recommended to proceed with the code as follows.

```javascript
// init Run the function afterwards
window.Dfinery.onInitialized(() => {
  Promise.race([
    window.Dfinery.logEvent("EVENT_NAME"),
    new Promise((resolve, reject) => {
      setTimeout(() => reject("Timed out"), 2000); // If you don't succeed within 2 seconds, you fail.
    }),
  ])
    .catch((error) => {
      //
    })
    .then(() => {
      // movement
      window.location.href = "https://www.dfinery.io/crm";
    });
});
```

{% hint style="info" %}
Adjust the timeout to reduce the impact of SDK errors. Depending on the timeout time and the client's network speed, collection may not be possible.
{% endhint %}
