ga_trackme_event: Opt in or out of googleAnalyticsR usage tracking

Description Usage Arguments Details Examples

View source: R/measurement_protocol.R

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

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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 documentation built on April 17, 2021, 5:06 p.m.