Google analytics on pageview of tabpanels under navbarPage

45 views
Skip to first unread message

Andrew Yip

unread,
May 30, 2015, 10:44:14 AM5/30/15
to shiny-...@googlegroups.com
Dear all, I've been trying to track views of tabs (tabpanels) under navbarPage. Following the GA guide https://developers.google.com/analytics/devguides/collection/analyticsjs/pages

I've something like this:

navbarPage(
title = "title",
    id = "shinyNav",
    collapsible = T,
    header=singleton(tags$head(includeScript('google-analytics.js'))),
    tabPanel
("tab1",
             includeScript("track.js")
            ),
    tabPanel("tab2",
             includeScript("track.js")
            )
)


where my track script is 

ga('send', 'pageview');

However, i cannot find the corresponding tabs showing up under contents in the GA dashboard. Could someone shed some light on how to properly track the different tab clicks structured in a navbarPage please? Thank you in advance.

Andrew Yip

unread,
May 30, 2015, 10:45:09 AM5/30/15
to shiny-...@googlegroups.com
a followup question: I realize the tab paths are pretty much #some-random-numbers. Is there a way to set the name of the paths of better tracking upon resolving the issue raised? Thanks.

Debashis Paul

unread,
Jan 18, 2017, 3:19:24 PM1/18/17
to Shiny - Web Framework for R
Hi Andrew 

Did you get this Event on tab click captured in Google analytics for tabpanel ? Can you help as we are on same boat . 
thanks and appreciate your help .
Reply all
Reply to author
Forward
0 new messages