Sha256: 15869df9865175bab15ade412a7ad44c78997024459eaee97549e77f5854c46f

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

module PlausibleApi
  module Stats
    class Breakdown < Base
      def initialize(options = {})
        @property = options[:property] || 'event:page' # required
        @period   = options[:period] || '30d' # required
        @metrics  = options[:metrics]
        @limit    = options[:limit]
        @page     = options[:page]
        @filters  = options[:filters]
        @date     = options[:date]
        @period = 'custom' if @date
        
      end

      def request_url_base
        "/api/v1/stats/breakdown?site_id=$SITE_ID"
      end

      def parse_response(body)
        JSON.parse(body)['results']
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plausible_api-0.1.5 lib/plausible_api/stats/breakdown.rb