Module: Drip::Client::Events
- Included in:
- Drip::Client
- Defined in:
- lib/drip/client/events.rb
Instance Method Summary collapse
-
#track_event(email, action, properties = {}) ⇒ Object
Public: Track an event.
-
#track_events(events) ⇒ Object
Public: Track a collection of events all at once.
Instance Method Details
#track_event(email, action, properties = {}) ⇒ Object
Public: Track an event.
email - Required. The String email address of the subscriber. action - Required. The String event action. properties - Optional. A Hash of event properties.
Returns a Drip::Response. See www.getdrip.com/docs/rest-api#record_event
14 15 16 17 |
# File 'lib/drip/client/events.rb', line 14 def track_event(email, action, properties = {}) data = { "email" => email, "action" => action, "properties" => properties } post "#{account_id}/events", generate_resource("events", data) end |
#track_events(events) ⇒ Object
Public: Track a collection of events all at once.
events - Required. An Array of between 1 and 1000 Hashes of event data.
- email - Required. The String email address of the subscriber.
- action - Required. The String event action.
- properties - Optional. A Hash of event properties.
Returns a Drip::Response. See www.getdrip.com/docs/rest-api#event_batches
28 29 30 31 |
# File 'lib/drip/client/events.rb', line 28 def track_events(events) url = "#{account_id}/events/batches" post url, generate_resource("batches", { "events" => events }) end |