Class: GoogleAnalytics::Events::Ecommerce::AddTransaction
- Inherits:
-
GoogleAnalytics::Event
- Object
- GoogleAnalytics::Event
- GoogleAnalytics::Events::Ecommerce::AddTransaction
- Defined in:
- lib/google-analytics/events/events.rb
Overview
JavaScript equivalent:
ga('ecommerce:addTransaction', { 'id': '1234', 'affiliation': 'Acme Clothing', 'revenue': '11.99', 'shipping': '5', 'tax': '1.29', 'currency': 'EUR' // local currency code. });
Instance Attribute Summary
Attributes inherited from GoogleAnalytics::Event
Instance Method Summary collapse
-
#initialize(order_id, store_name, total, tax, shipping, city = nil, state_or_province = nil, country = nil) ⇒ AddTransaction
constructor
A new instance of AddTransaction.
Methods inherited from GoogleAnalytics::Event
Constructor Details
#initialize(order_id, store_name, total, tax, shipping, city = nil, state_or_province = nil, country = nil) ⇒ AddTransaction
Returns a new instance of AddTransaction.
179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/google-analytics/events/events.rb', line 179 def initialize(order_id, store_name, total, tax, shipping, city=nil, state_or_province=nil, country=nil) # city.to_s, state_or_province.to_s, country.to_s super('ecommerce:addTransaction', { :id => order_id.to_s, :affiliation => store_name.to_s, :revenue => total.to_s, :tax => tax.to_s, :shipping => shipping.to_s }) end |