biothings / discovery-app

The Data Discovery Engine project by the CD2H Data working-group
http://discovery.biothings.io
Apache License 2.0
5 stars 12 forks source link

tracking discovery app with Google Analytics #87

Open newgene opened 3 years ago

newgene commented 3 years ago

Should track both website and API usage

flaneuse commented 3 years ago

@marcodarko in case it's helpful--

One tiny note based on a mistake I made with outbreak -- make sure that you're also tracking query parameters in the URL. I was using vue-gtag which makes it very easy to incorporate into Vue, but in the latest version, they weren't sending query params (like: https://discovery.biothings.io/niaid/search?q=ebola&filters=&size=10&from=1).

Based on a solution in this issue, code seems to be working well now: https://github.com/outbreak-info/outbreak.info/blob/master/web/src/main.js

If you want to get fancy, too, you can send custom events too...

marcodarko commented 3 years ago

Oh cool! Thanks for the tip!