pkgdown
pkgdown copied to clipboard
Possible to add another HTML option for analytics code?
I see in the docs that analytics code can be added in the header in_header
and after the body after_body
. We are being told that the best or "right" place for some Google Tag Manager analytics code is right after the opening <body>
tag, not at the end of the body, after it.
Is this something other pkgdown users would find useful? Is it possible to add a new option like that?
So this means https://github.com/r-lib/pkgdown/blob/c354aa7e5ea1f9936692494c28c89e5bdd31fc68/inst/BS5/templates/head.html#L92 should be moved? I can see the docs don't even mention that built-in GA support actually.
Note that you can use before_body
https://github.com/r-lib/pkgdown/blob/c354aa7e5ea1f9936692494c28c89e5bdd31fc68/inst/BS5/templates/layout.html#L11 (I guess it also means the docs need an update?)
Ah, before_body
would do it, yes! I am noticing that these are the same three options that Quarto has, which is great.
I don't have enough information or knowledge to know if the built-in GA support should move, but documenting the before_body
option would have set me on the path I needed, based on the instructions from our website team.