Add the consent script as early as possible in the document head, gate every non-essential script behind the visitor's consent state, and expose the.
A consent management API lets your code ask a consent platform what the visitor agreed to, so every script, component, and server process can respect.