Add Matomo
This commit is contained in:
parent
c814b5f435
commit
98e5fb0a3b
3 changed files with 26 additions and 30 deletions
|
|
@ -23,7 +23,8 @@ MAIL_FROM_NAME="${APP_NAME}"
|
|||
|
||||
MAIL_LIST_CONTACTFORM=
|
||||
|
||||
GOOGLE_ANALYTICS_ID=
|
||||
# Matomo
|
||||
MATOMO_SITE_ID=
|
||||
|
||||
LDC_STATUS_CHECKER_API_KEY="MY_KEY"
|
||||
LDC_STATUS_CHECKER_UUID="UUID_PROJECT"
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'google-analytics' => [
|
||||
'id' => env('GOOGLE_ANALYTICS_ID')
|
||||
]
|
||||
'matomo' => [
|
||||
'site_id' => env('MATOMO_SITE_ID')
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
47
resources/views/vendor/cn-cookies.blade.php
vendored
47
resources/views/vendor/cn-cookies.blade.php
vendored
|
|
@ -29,36 +29,31 @@ $strings = (object)[
|
|||
$cookies = [];
|
||||
|
||||
// ANALYCTICS
|
||||
$cookies['analytics'] = [
|
||||
'name' => __('MESURES D’AUDIENCE') . ' - Google Analytics',
|
||||
'description' => __('Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d’empêcher que ceux-ci ne soient soumis par des robots.'),
|
||||
'link' => 'https://policies.google.com/privacy',
|
||||
$cookies['matomo'] = [
|
||||
'name' => __('MESURES D\'AUDIENCE') . ' - Matomo',
|
||||
'description' => __('Service d\'analyse d\'audience'),
|
||||
'link' => 'https://fr.matomo.org/gdpr-analytics/',
|
||||
'labelLink' => __('En savoir +'),
|
||||
'cookies' => [
|
||||
'_ga',
|
||||
'_gat_gtag_' . str_replace("-", "_", config("ldcweb-cookies.analyticsKey")),
|
||||
'_gid'
|
||||
]
|
||||
'cookies' => ['_pk']
|
||||
];
|
||||
|
||||
$cookies['analytics']['script'] = <<<SCRIPT
|
||||
$cookies['matomo']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
(function (d, t) {
|
||||
var g = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src = 'https://www.googletagmanager.com/gtag/js?id={{ config("ldcweb-cookies.analyticsKey") }}';
|
||||
g.id = 'analytics';
|
||||
s.parentNode.insertBefore(g, s)
|
||||
}(document, 'script'));
|
||||
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ config("ldcweb-cookies.analyticsKey") }}');
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//yl.s-web.fr/";
|
||||
_paq.push(['setTrackerUrl', u+'rainbow']);
|
||||
_paq.push(['setSiteId', '
|
||||
SCRIPT;
|
||||
$cookies['matomo']['script'] .= config("services.matomo.site_id");
|
||||
$cookies['matomo']['script'] .= <<<SCRIPT
|
||||
']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'unicorn'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
}
|
||||
SCRIPT;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue