```ruby
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```

Load Mixpanel async and at the bottom of the page
user
```ruby
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```
assistant