Class: Tealium
- Inherits:
-
Object
- Object
- Tealium
- Defined in:
- lib/tealium.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#datasource ⇒ Object
Returns the value of attribute datasource.
-
#profile ⇒ Object
Returns the value of attribute profile.
Instance Method Summary collapse
-
#initialize(account, profile, datasource = nil) ⇒ Tealium
constructor
A new instance of Tealium.
- #track(event_name, custom_data = {}) ⇒ Object
Constructor Details
#initialize(account, profile, datasource = nil) ⇒ Tealium
Returns a new instance of Tealium.
6 7 8 9 10 |
# File 'lib/tealium.rb', line 6 def initialize(account, profile, datasource = nil) @account = account @profile = profile @datasource = datasource end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
4 5 6 |
# File 'lib/tealium.rb', line 4 def account @account end |
#datasource ⇒ Object
Returns the value of attribute datasource.
4 5 6 |
# File 'lib/tealium.rb', line 4 def datasource @datasource end |
#profile ⇒ Object
Returns the value of attribute profile.
4 5 6 |
# File 'lib/tealium.rb', line 4 def profile @profile end |
Instance Method Details
#track(event_name, custom_data = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tealium.rb', line 12 def track(event_name, custom_data = {}) data = Hash.new data[:tealium_account] = @account data[:tealium_profile] = @profile data[:tealium_datasource] = @datasource if @datasource data[:tealium_event] = event_name payload = data.merge(custom_data) TealiumCollect.collect(payload) end |