Add Yandex Metrika integration for tracking; update FindSliderBySlugTask to ensure active slides are filtered correctly based on time; enhance app.blade.php for conditional Yandex Metrika script inclusion based on environment.

This commit is contained in:
F4ilji
2025-09-27 22:35:36 +05:00
parent 02fb2554c1
commit 72af09d93d
6 changed files with 51 additions and 16 deletions
+26 -7
View File
@@ -6,7 +6,7 @@
@if (env('NGINX_ENV') === 'prod')
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
@endif
{{-- <title inertia>{{ config('app.name', 'Laravel') }}</title>--}}
{{-- <title inertia>{{ config('app.name', 'Laravel') }}</title>--}}
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
@@ -49,13 +49,32 @@
scroll-padding: 6rem;
scroll-behavior: smooth !important;
}
</style>
<body class="">
@inertia
</body>
</html>
@if(config('services.yandex_metrika.id') && app()->environment('production'))
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function(m,e,t,r,i,k,a){
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js', 'ym');
ym({{ config('services.yandex_metrika.id') }}, 'init', {
defer: true,
webvisor:true,
clickmap:true,
ecommerce:"dataLayer",
accurateTrackBounce:true,
trackLinks:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/{{ config('services.yandex_metrika.id') }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
@endif
</body>
</html>