Class: Rack::Tracker::GoogleAnalytics::Ecommerce

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/rack/tracker/google_analytics/google_analytics.rb

Instance Method Summary collapse

Methods inherited from OpenStruct

#to_h

Instance Method Details

#writeObject



39
40
41
42
43
44
45
46
# File 'lib/rack/tracker/google_analytics/google_analytics.rb', line 39

def write
  attributes = self.to_h.except(:type).compact.stringify_values

  [
    "ecommerce:#{self.type}",
    attributes
  ].to_json.gsub(/\[|\]/, '')
end