Module: Parse::API::Analytics
- Included in:
- Client
- Defined in:
- lib/parse/api/analytics.rb
Overview
Defines the Analytics interface for the Parse REST API
Instance Method Summary collapse
-
#send_analytics(event_name, metrics = {}, **opts) ⇒ Object
Send analytics data.
Instance Method Details
#send_analytics(event_name, metrics = {}, **opts) ⇒ Object
Send analytics data. Parse Server's default analyticsAdapter
is a no-op: events POSTed here are accepted but not persisted
and cannot be read back through Parse Server. Operators who wire
in a custom adapter decide what (if anything) to do with each
event, including whether to cap dimension count — the legacy
parse.com eight-pair cap does NOT apply to Parse Server out of
the box. If you need to read events back, persist them to a
regular Parse::Object subclass instead.
29 30 31 32 33 34 35 36 37 |
# File 'lib/parse/api/analytics.rb', line 29 def send_analytics(event_name, metrics = {}, **opts) safe = event_name.to_s unless safe.match?(/\A[\w\-\.]+\z/) raise ArgumentError, "Parse::API::Analytics#send_analytics: event_name must contain only " \ "word characters, hyphens, or dots (got #{event_name.inspect})" end request :post, "events/#{safe}", body: metrics, opts: opts end |