if ["production", "staging"].include?(Rails.env)
  mixpanel_conf = YAML::load_file(Rails.root.join('config/mixpanel.yml'))[Rails.env]['mixpanel']

  FactlinkUI::Application.config.mixpanel_token = mixpanel_conf['token']
  FactlinkUI::Application.config.mixpanel = MixpanelRails::Tracker

  FactlinkUI::Application.config.middleware.use "Mixpanel::Tracker::Middleware", mixpanel_conf['token']
else


  FactlinkUI::Application.config.mixpanel = MixpanelRails::DummyTracker
end
if ["production", "staging"].include?(Rails.env)
  mixpanel_conf = YAML::load_file(Rails.root.join('config/mixpanel.yml'))[Rails.env]['mixpanel']

  FactlinkUI::Application.config.mixpanel_token = mixpanel_conf['token']
  FactlinkUI::Application.config.mixpanel = MixpanelRails::Tracker

  FactlinkUI::Application.config.middleware.use "Mixpanel::Tracker::Middleware", mixpanel_conf['token'], async: true, insert_js_last: true
else


  FactlinkUI::Application.config.mixpanel = MixpanelRails::DummyTracker
end
Load Mixpanel async and at the bottom of the page
Load Mixpanel async and at the bottom of the page

Signed-off-by: tomdev <96835dd8bfa718bd6447ccc87af89ae1675daeca@codigy.nl>
