PricingBlog

Google Tag Manager and Cookiebot

  • alfred_66594-1499311254618112060

    Alfred

    4 hours ago

    I know the best practice is to setup Google Tag Manager and Cookiebot in head scripts, but I really do not want to manage hardcoded scripts across multiple pages. We do not load scripts on any pages, so I think an okay approach even if it is not best practice is to handle the Cookiebot setup script and the GTM initialisation as custom functions triggered sequentially by callbacks so they are set in order on the page load event.

    This is then placed in a global tracking component on every page root. But I do experience some problems on receiving analytics from page visits.

    I would like to hear if anyone has successfully found an implementation that works which is centralized?
  • andreasmoller-1499352510605820004

    Andreas Møller

    2 hours ago

    We are discussing ways to make it much easier to handle head content.

    IF you don't want to add the scripts to the head, I would recommend creating a component with all the scripts and load them as the first item in the body.
    🙌1