Google analytics tag for single html files #702
-
For web sites I see how to embed google analytics tags here: https://quarto.org/docs/websites/website-tools.html#google-analytics How would one do this for a standalone web page when I'm not using Quarto's web site capabilities? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
We currently only support this for websites, though you could certainly accomplish something similar by placing the Google Analytics script for your page in the header of the page using https://quarto.org/docs/output-formats/html-basics.html#includes |
Beta Was this translation helpful? Give feedback.
-
Is there a way to conditionally include? I was thinking to exclude the inclusion if the branch name is not main/master but clearly I cannot have inline R in the _quarto.yml ;-) Anybody has/had a similar need or any suggestions? |
Beta Was this translation helpful? Give feedback.
We currently only support this for websites, though you could certainly accomplish something similar by placing the Google Analytics script for your page in the header of the page using
include-in-header
(a path to a file) orheader-includes
(inline in the document front matter)https://quarto.org/docs/output-formats/html-basics.html#includes