googleanalytics / autotrack

Automatic and enhanced Google Analytics tracking for common user interactions on the web.
Other
4.93k stars 563 forks source link

Google analytics tracking doesn't require URL request to track a local R Shiny app #275

Closed matt-sd-watson closed 1 year ago

matt-sd-watson commented 1 year ago

I have added Google tracking to my R Shiny application as described in this article: https://shiny.rstudio.com/articles/google-analytics.html

and deployed the application through a shinyapps.io server as described here: https://shiny.rstudio.com/articles/shinyapps.html

The user tracking works as expected for events/user etc., except that Google Analytics is able to track the application when it is run locally through R Studio IDE, and doesn't require a URL access to the specific shinyapps.io URL where the app is deployed on the web.

This means that any local app development and testing conducted by developers on the app will be tracked by Google Analytics, which for our purposes will inflate the tracking statistics and generate many false positives for actual public app activity.

Is there a way to enforce that the user activity must come through a specific URL to avoid this local tracking? On Google Analytics I have set the specific URL for the app, but it does not seem to work.

matt-sd-watson commented 1 year ago

Resolved by modifying internal R code within the app to restrict to non-interactive sessions