• RV

    (@rismaviljoen)


    I’ve just started using Code Snippets to consolidate my snippets in one place – it is a great plugin thanks!

    I have added Cookiebot’s cookie consent script and it is displaying. However, I need to set it so that it is the first script to run in order to disable certain cookies/scripts until such time that the visitor consents to the use thereof (e.g marketing cookies, analytics etc.).

    I’ve been unable to find any documentation and changing the priority has not managed to achieve this. How do I go about setting it as the first script to run?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Do you have an example of the script you are working with? You can adjust the ‘priority’ setting, but this will only affect the order that snippets are loaded, not necessarily allow a particular snippet to run earlier in the WordPress load order.

    Thread Starter RV

    (@rismaviljoen)

    Thanks Shea, you answered my question. The priority setting will apply to snippets added via the plugin, but I needed a way to run the cookie consent script earlier with WP core and theme load. I have managed to find a workaround by adding the cookie consent script as a hooked element via my theme and using your plugin for all other snippets.

    Plugin Author Shea Bunge

    (@bungeshea)

    Glad to hear you could find a workaround!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cookie Consent – first script to run’ is closed to new replies.