diff --git a/.env.example b/.env.example index 26b1487ae..21a72526d 100644 --- a/.env.example +++ b/.env.example @@ -184,12 +184,6 @@ ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38: # SENTRY_DSN= -# MICROSOFT CLARITY -# MS_CLARITY_TOKEN=xxxxxxxxx - -# GOOGLE_TAG_MANAGER -# GOOGLE_TAG = GTM-XXXXXXX - ## Scout ## https://scoutapm.com/docs/ruby/configuration # SCOUT_KEY=YOURKEY diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 521d027cc..e656c2550 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -3,6 +3,7 @@ class DashboardController < ActionController::Base before_action :set_application_pack before_action :set_global_config + before_action :set_dashboard_scripts around_action :switch_locale before_action :ensure_installation_onboarding, only: [:index] before_action :render_hc_if_custom_domain, only: [:index] @@ -35,6 +36,10 @@ class DashboardController < ActionController::Base ).merge(app_config) end + def set_dashboard_scripts + @dashboard_scripts = GlobalConfig.get_value('DASHBOARD_SCRIPTS') + end + def ensure_installation_onboarding redirect_to '/installation/onboarding' if ::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING) end diff --git a/app/views/layouts/vueapp.html.erb b/app/views/layouts/vueapp.html.erb index eb129867c..cf800cda2 100644 --- a/app/views/layouts/vueapp.html.erb +++ b/app/views/layouts/vueapp.html.erb @@ -70,40 +70,8 @@
<%= yield %> - <% if @global_config['CHATWOOT_INBOX_TOKEN'].present? %> - - <% end %> - <% if ENV.fetch('MS_CLARITY_TOKEN', nil).present? %> - - <% end %> - <% if ENV.fetch('GOOGLE_TAG', nil).present? %> - + <% if @dashboard_scripts.present? %> + <%= @dashboard_scripts.html_safe %> <% end %>