Sha256: e67461ec9d04844e0ac53c9e050a60f7dbd6b23185b1ede8810b848706924757

Contents?: true

Size: 1.12 KB

Versions: 15

Compression:

Stored size: 1.12 KB

Contents

module Fastlane
  module Polidea
    class Analytics
      GA_TRACKING = "UA-165836496-1"
      private_constant :GA_TRACKING

      attr_accessor :session_id
      attr_accessor :client

      def initialize(session_id)
        @session_id = session_id
        @client = FastlaneCore::AnalyticsIngesterClient.new(GA_TRACKING)
        @client_id = "fastlane-plugin-polidea@#{Fastlane::Polidea::VERSION}"
      end

      def action_launched(action_name, config)
        client.post_request({
          client_id: @session_id,
          category: @client_id,
          action: action_name,
          label: "launched"
        })
        config.values.filter { |k, v| !v.nil? }.keys.each do |param|
          client.post_request({
            client_id: @session_id,
            category: @client_id,
            action: "#{action_name}::#{param}",
            label: "param"
          })
        end
      end

      def action_completed(action_name)
        client.post_request({
          client_id: @session_id,
          category: @client_id,
          action: action_name,
          label: "completed"
        })
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fastlane-plugin-polidea-4.0.1 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-4.0.1.pre lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-4.0.0 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-4.0.0.pre.3 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-3.0.1 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-4.0.0.pre.2 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-4.0.0.pre.1 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-4.0.0.pre lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-3.0.0 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-3.0.0.pre.2 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-3.0.0.pre.1 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-2.2.0.pre.1 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-2.2.0.pre lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-2.1.1.pre.2 lib/fastlane/plugin/polidea/helper/analytics.rb
fastlane-plugin-polidea-2.1.1.pre.1 lib/fastlane/plugin/polidea/helper/analytics.rb