Class: Rack::Tracker::GoogleAnalytics::EnhancedEcommerce
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Rack::Tracker::GoogleAnalytics::EnhancedEcommerce
- Defined in:
- lib/rack/tracker/google_analytics/google_analytics.rb
Instance Method Summary collapse
Methods inherited from OpenStruct
Instance Method Details
#write ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rack/tracker/google_analytics/google_analytics.rb', line 30 def write hash = self.to_h label = hash[:label] attributes = hash.except(:label, :type).compact.stringify_values [ "ec:#{self.type}", label, attributes.empty? ? nil : attributes ].compact.to_json.gsub(/\[|\]/, '') end |