-
Notifications
You must be signed in to change notification settings - Fork 9
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 injectable analytics to IG build at runtime. #12
Comments
@neuronsong Is this something you could hardcode into a template for now? |
Hey @neuronsong , Laura mentioned you may have been working on this yesterday. Is that true? If not I can take a look as well. |
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? |
The Logica org account with a new tracking ID. |
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. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-163789979-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-163789979-1'); </script> |
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. |
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.
The text was updated successfully, but these errors were encountered: