diff --git a/app/assets/javascripts/hotjar.js b/app/assets/javascripts/hotjar.js deleted file mode 100644 index 330f426fa..000000000 --- a/app/assets/javascripts/hotjar.js +++ /dev/null @@ -1,3 +0,0 @@ -// Hotjar Tracking Code for https://api.app.eva.beta.gouv.fr -(tarteaucitron.job = tarteaucitron.job || []).push('hotjar'); -tarteaucitron.user.hotjarId = 1981301;tarteaucitron.user.HotjarSv = 6; diff --git a/app/assets/javascripts/hotjar.js.erb b/app/assets/javascripts/hotjar.js.erb new file mode 100644 index 000000000..8fc8fb88a --- /dev/null +++ b/app/assets/javascripts/hotjar.js.erb @@ -0,0 +1,6 @@ +// Hotjar Tracking Code for https://api.app.eva.beta.gouv.fr +<% if ENV['HOTJAR_ID'].present? %> +tarteaucitron.user.hotjarId = <%= ENV['HOTJAR_ID'] %>; +tarteaucitron.user.HotjarSv = 6; +(tarteaucitron.job = tarteaucitron.job || []).push('hotjar'); +<% end %> diff --git a/app/assets/javascripts/matomo.js b/app/assets/javascripts/matomo.js.erb similarity index 66% rename from app/assets/javascripts/matomo.js rename to app/assets/javascripts/matomo.js.erb index 2087ad600..b5775a189 100644 --- a/app/assets/javascripts/matomo.js +++ b/app/assets/javascripts/matomo.js.erb @@ -1,4 +1,6 @@ // Matomo Tracking Code for https://api.app.eva.beta.gouv.fr +<% if ENV['MATOMO_ID'].present? %> tarteaucitron.user.matomoHost = 'https://stats.data.gouv.fr/'; -tarteaucitron.user.matomoId = 149; +tarteaucitron.user.matomoId = <%= ENV['MATOMO_ID'] %>; (tarteaucitron.job = tarteaucitron.job || []).push('matomohightrack'); +<% end %>