<commit_before>module Carto
  module Tracking
    class Events
    end
  end
end<commit_msg>add MapExported event<commit_after>require_dependency 'carto/tracking/segment_wrapper'

module Carto
  module Tracking
    module Events
      class MapExported
        EVENT_NAME = 'Exported map'.freeze

        def initialize(user_id, visualization_id)
          @user = Carto::User.find(user_id)
          @visualization = Carto::Visualization.find(visualization_id)
        end

        def report
          Carto::Tracking::SegmentWrapper.new(@user).send_event(@user, properties)
        end

        private

        def properties
          { privacy: @visualization.privacy,
            type: @visualization.type,
            id: @visualization.id }
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07224334600760456, 'fraction_numerical': 0.0, 'mean_word_length': 2.376068376068376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6316870', 'n_tokens_mistral': 233, 'n_tokens_neox': 220, 'n_words': 50}