Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ga_trackme_event

Opt in or out of googleAnalyticsR usage tracking


Description

You can opt-in or out to sending a measurement protocol hit when you load the package for use in the package's statistics via this function. No personal data is collected.

If you opt in, ga_trackme_event() is the function that fires. You can use debug_call=TRUE to see what would be sent before opting in or out.

Usage

ga_trackme()

ga_trackme_event(debug_call = FALSE, say_hello = NULL)

Arguments

debug_call

Set as a debug event to see what would be sent

say_hello

If you want to add your own custom message to the event sent, add it here!

Details

Running ga_trackme_event() function will send a Measurement Protocol hit via ga_mp_send only if the ~/.R/optin-googleanalyticsr file is present

Examples

# control your tracking choices via a menu if in interactive session
if(interactive()){
  ga_trackme()
}

# this only works with a valid opt-in file present 
ga_trackme_event()

# see what data is sent
ga_trackme_event(debug_call=TRUE)

# add your own message!
ga_trackme_event(debug_call = TRUE, say_hello = "err hello Mark")

googleAnalyticsR

Google Analytics API into R

v1.0.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Artem Klevtsov [ctb], Johann deBoer [ctb], David Watkins [ctb], Olivia Brode-Roger [ctb], Jas Sohi [ctb], Zoran Selinger [ctb], Octavian Corlade [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.