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



44
45
46
47
48
49
50
51
# File 'lib/rack/tracker/google_analytics/google_analytics.rb', line 44

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

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