Google Analytics tracking of multiple buttons and tabs in Shiny app


I saw this self-answered post which gave me some direction, and a whole bunch of Stack overflow questions about the same issue with no answers. My question has to do with tracking individual elements on a Shiny app, which should require using ga() function call as suggested here. My knowledge of javascript is non-existent, but I roughly understand how the function works to send tracking data from individual components. What I don't know is how can I construct the ga() function for individual elements.

By using the developer view from browser, I examined individual segments of my app and I see similar tags for different components such as <button> that controls app firing and drop-down selection menus. Similarly, I have multiple tabs which are listed under <a> hyperlink tags. I'd like to be able to track user interactions for each of these components separately. Does that mean I need to create a dedicated ga() function for each of the elements? And if so how do I write the javascript function for this purpose?


This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.