gmr_post: Post data to Measurement Protocol

Description Usage Arguments Details Value See Also

View source: R/make_call.R

Description

Send data to the Google Analytics API endpoint.

Usage

1
2
3
gmr_post(payload_data, tid = Sys.getenv("MP_TRACKING_ID"),
  hittype = c("pageview", "screenview", "event", "transaction", "item",
  "social", "exception", "timing"))

Arguments

payload_data

A named list of paramters to send.

tid

Tracking ID. By default from the Sys environment MP_TRACKING_ID, overwritten if tid also sent in payload_data

hittype

Either specify in argument payload_data$t or here.

Details

Hits are sent via httr::POST and are URL encoded.

The version argument is set for you: v=1L

ip is implicitly sent in the HTTP request and is used to compute all the geo / network dimensions in Google Analytics. Override with payload_data$uip = 1.2.3.4

Set options("googleMeasureR.debug" = TRUE) to activate debug mode.

Value

TRUE if successful

See Also

https://developers.google.com/analytics/devguides/collection/protocol/v1/


MarkEdmondson1234/googleMeasureR documentation built on Oct. 27, 2019, 9:02 p.m.