Shiny Google Analytics User Tracking

I've been trying to set up user id tracking on a shinyapps.io app with authentication but having no luck.

Does anyone have any example code that works? I tried putting the Shiny.user function before the sending the pageview as suggested above but it still doesn't seem to be working.

Thanks!