Skip to content

Commit

Permalink
add g analytics fix FredHutch#79
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Mar 7, 2024
1 parent 384d91b commit 0247d49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ui <- dashboardPage(
rclipboard::rclipboardSetup(),
enter_to_click,
tooltip_style,
google_analytics,
tabItems(
tab_welcome,
tab_servers,
Expand Down
2 changes: 2 additions & 0 deletions app/ui_components.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ tooltip_style <- tags$style(

enter_to_click <- tags$script(src = "js/keyup.js")

google_analytics <- tags$head(includeHTML(path = "www/google-analytics.html"))

table_footer <- function(timezone = TRUE, copy = TRUE) {
tz <- if (timezone) "Dates are in Pacific time zone" else ""
cp <- ""
Expand Down
9 changes: 9 additions & 0 deletions app/www/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-R8GYMTMNX1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-R8GYMTMNX1');
</script>

0 comments on commit 0247d49

Please sign in to comment.