Module: Workarea::Listrak::Analytics::Helper

Defined in:
app/helpers/workarea/listrak/analytics/helper.rb

Instance Method Summary collapse

Instance Method Details

#cart_view_analytics_data(order) ⇒ Object



15
16
17
18
19
20
21
# File 'app/helpers/workarea/listrak/analytics/helper.rb', line 15

def cart_view_analytics_data(order)
  event = super
  payload = event[:payload].merge(
    token: order.token
  )
  event.merge(payload: payload)
end

#order_analytics_data(order) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/helpers/workarea/listrak/analytics/helper.rb', line 5

def order_analytics_data(order)
  super.merge(
    user_id: order.user_id,
    email: order.email,
    subtotal_price: order.subtotal_price.to_f,
    first_name: order_first_name(order),
    last_name: order_last_name(order)
  )
end

#order_item_analytics_data(item) ⇒ Object



23
24
25
26
27
28
# File 'app/helpers/workarea/listrak/analytics/helper.rb', line 23

def order_item_analytics_data(item)
  super.merge(
    image_url: product_image_url(item.image, :large_thumb),
    slug: item.product.to_param
  )
end