Where do I install the GA4 header tag (on each page), since there does not seem to be a "header" tag in GRAV?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
@stephanckdt, Template partials/base.html.twig is used by Quark as the base template for all inheriting templates like default.html.twig, blog.html.twig, etc.
I presume other themes follow the same logic.
If you inject the GA4 script in template partials/base.html.twig directly below the <head> element, all pages will contain the GA4 script.
@pamtbaau:
partials/base.html.twig
Thanks a lot, Pam. I'm non-techie. So where is the partials/base.html.twig on my GRAV backend to be found so I can insert the code? I'd appreciate step-by step.
@stephanckdt, In most themes, if not all, template base.html.twig can be found in folder /user/themes/yourtheme/templates/partials.
Be aware when updating a theme which you have downloaded, that you may loose your changes when a new version of the theme gets released. To prevent the loss of your changes, you should first create a child theme that inherits from your downloaded theme and make changes only in the newly created child theme. See Inheriting using the CLI.
Alternatively, you could use a plugin that loads the Analytics script, but unfortunately, none supports GA4 at the moment.
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 6 | 94 | 8 months ago | ||
| 10 | 184 | 1 year ago | ||
| 4 | 146 | 1 year ago | ||
| 3 | 60 | 1 year ago | ||
| 4 | 254 | 1 year ago |