1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #8083 from LarsK1/matomo-fixes

Fixes for Matomo
This commit is contained in:
David Bomba 2022-12-20 17:34:24 +11:00 committed by GitHub
commit 0b31483467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 9 deletions

View File

@ -9,7 +9,7 @@
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setUserId', '{{ auth()->guard('contact')->user()->company->present()->name }}']);
_paq.push(['setUserId', '{{ auth()->guard('contact')->user()->present()->name() }}']);
(function() {
var u="{{ $company->matomo_url }}";
_paq.push(['setTrackerUrl', u+'matomo.php']);
@ -57,7 +57,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="@yield('meta_description')"/>
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
@ -169,7 +169,7 @@
}
</script>
@endif
</body>
<footer>

View File

@ -9,7 +9,7 @@
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setUserId', '{{ auth()->guard('contact')->user()->company->present()->name }}']);
_paq.push(['setUserId', '{{ auth()->guard('contact')->user()->present()->name() }}']);
(function() {
var u="{{ $company->matomo_url }}";
_paq.push(['setTrackerUrl', u+'matomo.php']);

View File

@ -9,7 +9,6 @@
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setUserId', '{{ auth()->guard('contact')->user()->company->present()->name }}']);
(function() {
var u="{{ $company->matomo_url }}";
_paq.push(['setTrackerUrl', u+'matomo.php']);

View File

@ -3,8 +3,23 @@
<head>
<!-- Error: {{ session('error') }} -->
@if (config('services.analytics.tracking_id'))
@if (isset($company) && $company->matomo_url && $company->matomo_id)
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setUserId', '{{ auth()->guard('vendor')->user()->present()->name() }}']);
(function() {
var u="{{ $company->matomo_url }}";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ $company->matomo_id }}']);
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>
<noscript><p><img src="{{ $company->matomo_url }}/matomo.php?idsite={{ $company->matomo_id }}&amp;rec=1" style="border:0;" alt="" /></p></noscript>
@elseif (config('services.analytics.tracking_id'))
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-122229484-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@ -42,7 +57,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="@yield('meta_description')"/>
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
@ -157,7 +172,7 @@
}
</script>
@endif
</body>
<footer>