From b112fc0c81d4c165412b9d9755895fe8005150c5 Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Wed, 5 Jul 2023 20:40:49 +0300 Subject: [PATCH] add analytics tools --- Gemfile | 1 + Gemfile.lock | 2 ++ app/views/layouts/application.html.erb | 1 + app/views/layouts/form.html.erb | 2 +- app/views/layouts/plain.html.erb | 1 + app/views/shared/_meta.html.erb | 3 +++ app/views/shared/_posthog.html.erb | 4 ++++ app/views/shared/_settings_nav.html.erb | 2 +- config/initializers/active_storage.rb | 2 +- config/initializers/rollbar.rb | 11 +++++++++++ 10 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 app/views/shared/_posthog.html.erb create mode 100644 config/initializers/rollbar.rb diff --git a/Gemfile b/Gemfile index 5c5e6dd7..739b08c5 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ gem 'premailer-rails' gem 'puma' gem 'rails' gem 'rails-i18n' +gem 'rollbar' gem 'ruby-vips' gem 'shakapacker' gem 'sqlite3' diff --git a/Gemfile.lock b/Gemfile.lock index 831526da..4ae192f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -379,6 +379,7 @@ GEM railties (>= 5.2) retriable (3.1.2) rexml (3.2.5) + rollbar (3.4.0) rspec-core (3.12.2) rspec-support (~> 3.12.0) rspec-expectations (3.12.3) @@ -517,6 +518,7 @@ DEPENDENCIES puma rails rails-i18n + rollbar rspec-rails rubocop rubocop-performance diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d10189cf..365cf0b5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,6 +10,7 @@ <%= csp_meta_tag %> <%= javascript_pack_tag 'application', defer: true %> <%= stylesheet_pack_tag 'application', media: 'all' %> + <%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %> diff --git a/app/views/layouts/form.html.erb b/app/views/layouts/form.html.erb index 7a9ae00c..018ba925 100644 --- a/app/views/layouts/form.html.erb +++ b/app/views/layouts/form.html.erb @@ -6,11 +6,11 @@ <%= render 'shared/meta' %> - <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= javascript_pack_tag 'form', defer: true %> <%= stylesheet_pack_tag 'form', media: 'all' %> + <%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %> <%= yield %> diff --git a/app/views/layouts/plain.html.erb b/app/views/layouts/plain.html.erb index a16e46d5..e7902f02 100644 --- a/app/views/layouts/plain.html.erb +++ b/app/views/layouts/plain.html.erb @@ -10,6 +10,7 @@ <%= csp_meta_tag %> <%= javascript_pack_tag 'application', defer: true %> <%= stylesheet_pack_tag 'application', media: 'all' %> + <%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %> <% if flash.present? %><%= render 'shared/flash' %><% end %> diff --git a/app/views/shared/_meta.html.erb b/app/views/shared/_meta.html.erb index 4074c8a7..30d712c1 100644 --- a/app/views/shared/_meta.html.erb +++ b/app/views/shared/_meta.html.erb @@ -1,3 +1,6 @@ +<% if Docuseal.demo? || (request.path != '/' && !devise_controller?) %> + +<% end %> diff --git a/app/views/shared/_posthog.html.erb b/app/views/shared/_posthog.html.erb new file mode 100644 index 00000000..5699ecc2 --- /dev/null +++ b/app/views/shared/_posthog.html.erb @@ -0,0 +1,4 @@ + diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index 13e6b7fc..59e3a1f5 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -1,4 +1,4 @@ -
+