Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to include Google analytics scripts in IG pages #256

Open
ElliotSilver opened this issue Oct 31, 2024 · 5 comments
Open

Add ability to include Google analytics scripts in IG pages #256

ElliotSilver opened this issue Oct 31, 2024 · 5 comments

Comments

@ElliotSilver
Copy link
Contributor

To track page views, add following script just after </head> on every page of the IG.

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ABCDE12345"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-ABCDE12345');
</script>

G-ABCDE12345 should be replaced by a variable that can be specified in features.yml (?)

@costateixeira
Copy link
Collaborator

if we do this I would just make sure it is conditional to the existence of the google analytics ID, to make sure templates or IGs that don't provide the ID would not have broken javascript

@ElliotSilver
Copy link
Contributor Author

@costateixeira, of course. That would also give people who don't want google tracking to avoid it.

@ElliotSilver
Copy link
Contributor Author

This is a followup to HL7/fhir-ig-publisher#383 which was interpreted to only request a way to specify an ID, not to actually specify and use it.

@grahamegrieve
Copy link
Contributor

This is a template thing, nothing to do with the publisher

@costateixeira
Copy link
Collaborator

Transferring to https://github.com/HL7/ig-template-base, where this belongs

@costateixeira costateixeira transferred this issue from HL7/fhir-ig-publisher Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants