1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Add analytics (#1183)

* Add analytics only for main website
This commit is contained in:
Sergey Panteleev
2024-12-10 14:29:57 +03:00
committed by GitHub
parent b514904cc7
commit 850039a5ee
2 changed files with 26 additions and 1 deletions

View File

@@ -91,6 +91,25 @@ if (!isset($config["languages"])) {
<?php if (isset($config['meta_tags'])) { echo $config['meta_tags']; } ?>
<?php if (is_primary_site()) { ?>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.php.net/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<?php } ?>
</head>
<body class="<?php echo $curr; ?> <?php echo $classes; ?>">

View File

@@ -31,9 +31,15 @@ site_header("Privacy Policy", ["current" => "footer"]);
<h2>Cookies</h2>
<p>
php.net uses cookies to keep track of <a href="/my.php">user preferences</a>. Unless
you login on the site, the cookies will not be used to store personal information and
you login on the site, the cookies will not be used to store personal information, and
we do not give away the information from the cookies.
</p>
<p>
We also use self-hosted analytics service to improve popular sections of the documentation,
and never share user data with third parties.
You may deactivate or restrict the transmission of cookies by changing the settings of your web browser.
Cookies that are already stored may be deleted at any time.
</p>
<?php
site_footer();