Class: Forem::Services::AnalyticsService
- Inherits:
-
BaseService
- Object
- BaseService
- Forem::Services::AnalyticsService
- Defined in:
- lib/forem/services/analytics_service.rb
Overview
Service for interacting with the Forem Analytics API.
Provides engagement and traffic data for articles and organizations. Access via Client#analytics. All methods inject the client's requestor automatically so no additional configuration is required.
Instance Method Summary collapse
-
#historical(params = {}, opts = {}) ⇒ Array<Analytics>
Retrieve historical engagement metrics broken down by day.
-
#past_day(params = {}, opts = {}) ⇒ Analytics
Retrieve engagement metrics for the past 24 hours.
-
#referrers(params = {}, opts = {}) ⇒ Array<Analytics>
Retrieve referrer traffic data for a user or organization's content.
-
#totals(params = {}, opts = {}) ⇒ Analytics
Retrieve total engagement metrics for a user or organization.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Forem::Services::BaseService
Instance Method Details
#historical(params = {}, opts = {}) ⇒ Array<Analytics>
Retrieve historical engagement metrics broken down by day.
56 57 58 |
# File 'lib/forem/services/analytics_service.rb', line 56 def historical(params = {}, opts = {}) Analytics.historical(params, opts_with_requestor(opts)) end |
#past_day(params = {}, opts = {}) ⇒ Analytics
Retrieve engagement metrics for the past 24 hours.
72 73 74 |
# File 'lib/forem/services/analytics_service.rb', line 72 def past_day(params = {}, opts = {}) Analytics.past_day(params, opts_with_requestor(opts)) end |
#referrers(params = {}, opts = {}) ⇒ Array<Analytics>
Retrieve referrer traffic data for a user or organization's content.
88 89 90 |
# File 'lib/forem/services/analytics_service.rb', line 88 def referrers(params = {}, opts = {}) Analytics.referrers(params, opts_with_requestor(opts)) end |
#totals(params = {}, opts = {}) ⇒ Analytics
Retrieve total engagement metrics for a user or organization.
Returns all-time totals for page views, reactions, comments, and follows.
33 34 35 |
# File 'lib/forem/services/analytics_service.rb', line 33 def totals(params = {}, opts = {}) Analytics.totals(params, opts_with_requestor(opts)) end |