INL / corpus-frontend

BlackLab Frontend, a feature-rich corpus search interface for BlackLab.
16 stars 7 forks source link

Updated the code for Google Analytics in the header.vm and footer.vm … #450

Closed stcoats closed 1 year ago

stcoats commented 1 year ago

Changed header.vm and footer.vm to get the Google Analytics plugin working correctly.

stcoats commented 1 year ago

Update: removing the Analytics code from the footer.vm file has unintended consequences. It works as intended, as far as I can tell, if the code I changed is both in header.vm, in the head, and in footer.vm. But I don't really understand the overall system architecture, so I will close the pull request!

KCMertens commented 1 year ago

Curious what you mean by unintended consequences? I haven't worked with gtag a lot so I can't tell you exactly what's happening here though. I'll look at it in due time, but in the meantime, if you'd like to take another shot to get it working for yourself:

Logging specificially is pretty cut and dry. The application just calls a hardcoded window.ga or Vue.$plausible() here and there. So at least that's pretty cut and dry. You might have to hunt them down (a global search for ga( should find them all ) and replace them by calls to gtag (and maybe slightly change the arguments if the spec changed, but I'm not up to date on this).

Re. architecture: