Merge pull request #6915 from adullact/feature/6872-matomo-domain-config
Configuration du domaine de Matomo
This commit is contained in:
commit
cf1f92409c
4 changed files with 9 additions and 3 deletions
|
@ -276,6 +276,8 @@ class ApplicationController < ActionController::Base
|
||||||
matomo = Rails.application.secrets.matomo
|
matomo = Rails.application.secrets.matomo
|
||||||
|
|
||||||
{
|
{
|
||||||
|
cookie_domain: matomo[:cookie_domain],
|
||||||
|
domain: matomo[:domain],
|
||||||
enabled: matomo[:enabled],
|
enabled: matomo[:enabled],
|
||||||
host: matomo[:host],
|
host: matomo[:host],
|
||||||
key: matomo[:client_key]
|
key: matomo[:client_key]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { enabled, host, key } = gon.matomo || {};
|
const { cookieDomain, domain, enabled, host, key } = gon.matomo || {};
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
window._paq = window._paq || [];
|
window._paq = window._paq || [];
|
||||||
|
@ -10,8 +10,8 @@ if (enabled) {
|
||||||
// Configure Matomo analytics
|
// Configure Matomo analytics
|
||||||
//
|
//
|
||||||
|
|
||||||
window._paq.push(['setCookieDomain', '*.www.demarches-simplifiees.fr']);
|
window._paq.push(['setCookieDomain', cookieDomain]);
|
||||||
window._paq.push(['setDomains', ['*.www.demarches-simplifiees.fr']]);
|
window._paq.push(['setDomains', [domain]]);
|
||||||
// Don’t store any cookies or send any tracking request when the "Do Not Track" browser setting is enabled.
|
// Don’t store any cookies or send any tracking request when the "Do Not Track" browser setting is enabled.
|
||||||
window._paq.push(['setDoNotTrack', true]);
|
window._paq.push(['setDoNotTrack', true]);
|
||||||
// When enabling external link tracking, consider that it will also report links to attachments.
|
// When enabling external link tracking, consider that it will also report links to attachments.
|
||||||
|
|
|
@ -67,6 +67,8 @@ SENTRY_DSN_JS=""
|
||||||
|
|
||||||
# External service: Matomo web analytics
|
# External service: Matomo web analytics
|
||||||
MATOMO_ENABLED="disabled"
|
MATOMO_ENABLED="disabled"
|
||||||
|
MATOMO_COOKIE_DOMAIN="*.www.demarches-simplifiees.fr"
|
||||||
|
MATOMO_DOMAIN="*.www.demarches-simplifiees.fr"
|
||||||
MATOMO_ID=""
|
MATOMO_ID=""
|
||||||
MATOMO_HOST="matomo.example.org"
|
MATOMO_HOST="matomo.example.org"
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,8 @@ defaults: &defaults
|
||||||
smtp_key: <%= ENV['SENDINBLUE_SMTP_KEY'] %>
|
smtp_key: <%= ENV['SENDINBLUE_SMTP_KEY'] %>
|
||||||
api_v3_key: <%= ENV['SENDINBLUE_API_V3_KEY'] %>
|
api_v3_key: <%= ENV['SENDINBLUE_API_V3_KEY'] %>
|
||||||
matomo:
|
matomo:
|
||||||
|
cookie_domain: "<%= ENV['MATOMO_COOKIE_DOMAIN'] %>"
|
||||||
|
domain: "<%= ENV['MATOMO_DOMAIN'] %>"
|
||||||
enabled: <%= ENV['MATOMO_ENABLED'] == 'enabled' %>
|
enabled: <%= ENV['MATOMO_ENABLED'] == 'enabled' %>
|
||||||
host: <%= ENV['MATOMO_HOST'] %>
|
host: <%= ENV['MATOMO_HOST'] %>
|
||||||
client_key: <%= ENV['MATOMO_ID'] %>
|
client_key: <%= ENV['MATOMO_ID'] %>
|
||||||
|
|
Loading…
Reference in a new issue