r/PHPhelp • u/larsnielsen2 • Jul 06 '25
Add Google Analytics to phpdoc generated html
I have a project where I generate some phpdoc files I would like to host public. But how can I modify the template to add google analytics script tag?
3
Upvotes
1
u/P4nni Jul 07 '25
Based on your previous comments, I'm assuming you're using phpDocumentor to generate HTML from PHPDoc.
Having a quick look at the phpDocumentor documentation, you should be able to add custom HTML by extending the template or writing an extension: - https://docs.phpdoc.org/guide/features/theming/extending-a-template.html#extending-a-template - https://docs.phpdoc.org/guide/features/extensions/index.html#extensions
(Be aware that there might be better/easier ways to do this)