ga_mp_event_item: Create an Measurement Protocol Item Property for an Event

Description Usage Arguments See Also Examples

View source: R/measurement_protocol.R

Description

[Experimental] Some events work with item properties

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ga_mp_event_item(
  item_id = NULL,
  item_name = NULL,
  coupon = NULL,
  discount = NULL,
  affiliation = NULL,
  item_brand = NULL,
  item_category = NULL,
  item_variant = NULL,
  price = NULL,
  currency = NULL
)

Arguments

item_id

Item ID

item_name

Item Name

coupon

Coupon

discount

Discount

affiliation

Affiliation

item_brand

Brand

item_category

Category

item_variant

Variant

price

Price

currency

Currency

See Also

Other Measurement Protocol functions: ga_mp_cid(), ga_mp_event(), ga_mp_send()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# one item
ga_mp_event_item(item_name = "jeggings", 
                 price = 8.88, 
                 item_variant = "Black")
                 
# many items in a list
items <- list(
  ga_mp_event_item(item_id = "SKU_12345", 
                   price = 9.99, 
                   item_brand = "Gucci"), 
  ga_mp_event_item(item_name = "jeggings", 
                   price = 8.88, 
                   item_variant = "Black"))
                   
# construct an event with its own fields
ga_mp_event("add_payment_info", 
            params = list(coupon = "SUMMER_FUN", 
                          payment_type = "Credit Card", 
                          value = 7.77, 
                          currency = "USD"), 
            items = items)

googleAnalyticsR documentation built on April 17, 2021, 5:06 p.m.