cartodb-4.42/lib/carto/tracking/services/segment.rb
2024-04-06 05:25:13 +00:00

21 lines
495 B
Ruby

module Carto
module Tracking
module Services
module Segment
def report_to_segment
return unless segment_api_key
segment_job = Resque::TrackingJobs::SendSegmentEvent
supplied_properties = @format.to_segment
Resque.enqueue(segment_job, @reporter.try(:id), name, supplied_properties)
end
def segment_api_key
@segment_api_key ||= Cartodb.get_config(:segment, 'api_key')
end
end
end
end
end