Skip to content

Commit

Permalink
feat: matomo migration from stats.data.gouv to stats.beta.gouv
Browse files Browse the repository at this point in the history
  • Loading branch information
Doniaab committed Dec 15, 2023
1 parent 0be3ed1 commit 145d8a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
13 changes: 8 additions & 5 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@
</link>

<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
<script>
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://stats.data.gouv.fr/";
var u="https://stats.beta.gouv.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', 160]);
_paq.push(['setSiteId', '76']);
_paq.push(['setCookieSameSite', 'None']);
_paq.push(['setSecureCookie', true]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

<!-- Leaflet -->
<link rel="stylesheet" href="/styles/leaflet.css" />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/PrivacyPolicy/PrivacyPolicy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ const PrivacyPolicy = () => {
<p>
Vous pouvez accéder aux statistiques d’usage disponibles en accès libre sur
{' '}
<a target="_blank" rel="noopener noreferrer" href="https://stats.data.gouv.fr/index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite=160#?idSite=160&period=day&date=yesterday&segment=&category=Dashboard_Dashboard&subcategory=1">stats.data.gouv.fr</a>
<a target="_blank" rel="noopener noreferrer" href="https://stats.beta.gouv.fr/index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite=76#?idSite=76&period=day&date=yesterday&segment=&category=Dashboard_Dashboard&subcategory=1">stats.beta.gouv.fr</a>
.
</p>

Expand All @@ -580,7 +580,7 @@ const PrivacyPolicy = () => {
<iframe
title="stats"
style={{ border: 0, height: 120, width: '100%' }}
src="https://stats.data.gouv.fr/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=&fontColor=&fontSize=&fontFamily=%22Marianne%22%2C%20arial%2C%20sans-serif"
src="https://stats.beta.gouv.fr/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=&fontColor=&fontSize=&fontFamily=%22Marianne%22%2C%20arial%2C%20sans-serif"
/>
<p>
Vous pouvez également refuser l’utilisation des cookies nécessitant votre consentement
Expand Down
6 changes: 3 additions & 3 deletions utils/csp-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default helmet.contentSecurityPolicy({
...helmet.contentSecurityPolicy.getDefaultDirectives(),
'script-src': [
"'self'",
'https://stats.data.gouv.fr/',
'https://stats.beta.gouv.fr/',
// Matomo script hash
"'sha256-4sJsjD6jok0r8RIemFeNZ1nEQfYv6qdzYIaUCTrSIhs='",
'https://static.axept.io/',
Expand All @@ -20,7 +20,7 @@ export default helmet.contentSecurityPolicy({
],
'img-src': [
"'self'",
'https://stats.data.gouv.fr/',
'https://stats.beta.gouv.fr/',
'https://*.tile.openstreetmap.org/',
'https://axeptio.imgix.net',
'https://www.google.com/',
Expand All @@ -37,7 +37,7 @@ export default helmet.contentSecurityPolicy({
'connect-src': [
"'self'",
'https://nominatim.openstreetmap.org',
'https://stats.data.gouv.fr/',
'https://stats.beta.gouv.fr/',
'https://client.axept.io/',
],
},
Expand Down

0 comments on commit 145d8a0

Please sign in to comment.