logicahealth / covid-19

COVID-19 / SARS-CoV-2 FHIR Profiles Implementation Guide (IG)
https://covid-19-ig.logicahealth.org
17 stars 9 forks source link

Add injectable analytics to IG build at runtime. #12

Open preston opened 4 years ago

preston commented 4 years ago

For general web assets we have an organizational Google Analytics account. It would be nice to allow for runtime injection of a GA key. We could also do similarly on the server side with logs, but we don't have that infrastructure established yet.

preston commented 4 years ago

@neuronsong Is this something you could hardcode into a template for now?

preston commented 4 years ago

Hey @neuronsong , Laura mentioned you may have been working on this yesterday. Is that true? If not I can take a look as well.

neuronsong commented 4 years ago

Ah, just seeing this. I turned on basic analytics for logicahealth.org website. There are multiple options to tie in google analytics... but they seem to require a third party account or at least a third party layer. I enabled the most basic of analytics for the time being.

In regard to a template... this should be really simple. Which GA account would you like to use?

preston commented 4 years ago

The Logica org account with a new tracking ID.

neuronsong commented 4 years ago

K, np.

I created an account for covid-19-ig... with the following new tag. I'll throw this into the global header of the template and push it in a minute. I think the ig has one and only one global header... but I've been wrong before in regard to the ig code.

neuronsong commented 4 years ago

I hardcoded this into a template for now. Based on the way I had to make this work it will be very easy to inject in the build process. Add a single line to the logica-template/includes/fragment-pagebegin.html file. Then, inject the right code into logica-template/content/assets/js/ga.js file.