Consent v2 Required by law 25 in Quebec

How can I insert a consent script v2 in the header and ensure that it is read first by the browser? Is pasting it at the top of the canvas will be enough?