• I have a foolish question. I’m trying to set up a working Google Analytics opt-in without adding a separate plugin to do it. The developers of the GDPR plugin suggested the following cookie-based script:

    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-X"></script>
    <script>
      if (is_allowed_cookie('_ga') && is_allowed_cookie('_gid')) {
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());gtag('config', 'UA-XXXXXXX-X', {"anonymize_ip":true,"allow_display_features":false,"link_attribution":false});
      }
    </script>

    My question is this: In Frontier, would this script work if added to the Custom <head> codes section of the Frontier Options, or do I have to implement it through functions.php? I understand what the script is supposed to do, but I haven’t been able to get it to work reliably. (I don’t know if this is too complex for the custom head code or won’t work in that spot for other reasons.) If you had any suggestions, I’d be much obliged.

    Thanks!

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

  • The topic ‘Script in custom header?’ is closed to new replies.