Add Custom HTML Header Support (Google Tag Manager and Analytics)
Problem to solve
In our on-prem GitLab installation we want to customise the UI (to replace the add project interface for example with our own .net portal which uses the API to create projects). I suspect there are many other use cases for hiding/moving/adding features effortlessly through Google Tag Manager (GTM).
It is simple enough to modify the _head.html.haml (as mentioned in my blog https://tickett.wordpress.com/2018/01/29/tweaking-gitlab-html-ui-using-google-tag-manager/) but would there be a desire to make this idiot proof through the UI?
Our GitLab installation is not public facing, however, it makes sense for public facing installations that organizations would want to gather data on usage etc. Hence, while adding GTM support perhaps it would make sense to add Google Analytics (GA) support and in fact support for any generic HTML/JavaScript to be added to the header?
Intended users
Unknown.
Further details
N/A.
Proposal
Add a configuration option under the admin area settings or appearance menu? (and store this in the database). Then generate the appropriate HTML in the header.
I would be happy/like to look at coding this feature although I am very new to the GitLab code stack so may need some direction.
Permissions and Security
I believe only admins should be able to access this feature (hence it being configurable within the admin screens).
Documentation
Testing
We would need to ensure it is not possible to enter something invalid which causes GitLab to error and prevents access to the admin panel to revert/fix!
It is important anyone using custom headers is aware of what headers they are using, why and how they might impact GitLab (so issues are raised pertaining to customizations in place for specific organizations).
What does success look like, and how can we measure that?
Once implemented, admins should be able to enter custom HTML through the UI to add headers to all pages (including things such as GTM and GA).