Disable FLoC in Svelte

- 1 minute read

SvelteKit is equipped with a configuration file option to disable FLoC by adding a response header that tells Google Chrome that your site wants to opt out.

If you’re not familiar with FLoC, it stands for Federated Learning of Cohorts. In short, it is a targeted advertising technology initiated by Google Chrome, widely criticized for its invasive attempt at replacing third-party cookies.

Anyway, you can disable it by setting floc to false in your svelte.config.js file:

kit: {
    floc: false,
    ...
},
...

In newer versions of SvelteKit, FLoC is disabled automatically, but you might want to check your configuration file just to be sure.

Link to this section Conclusion

Anyway, I hope this helped you out! Thanks for reading.