mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix an issue where the trackEvent function is being called before it has been defined.
This commit is contained in:
parent
572e307362
commit
c765200599
@ -57,6 +57,39 @@
|
|||||||
<script src="{{ asset('built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
<script src="{{ asset('built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@if (request()->phantomjs)
|
||||||
|
function trackEvent(category, action) {
|
||||||
|
}
|
||||||
|
@elseif (Utils::isNinjaProd() && isset($_ENV['ANALYTICS_KEY']) && $_ENV['ANALYTICS_KEY'])
|
||||||
|
(function (i, s, o, g, r, a, m) {
|
||||||
|
i['GoogleAnalyticsObject'] = r;
|
||||||
|
i[r] = i[r] || function () {
|
||||||
|
(i[r].q = i[r].q || []).push(arguments)
|
||||||
|
}, i[r].l = 1 * new Date();
|
||||||
|
a = s.createElement(o),
|
||||||
|
m = s.getElementsByTagName(o)[0];
|
||||||
|
a.async = 1;
|
||||||
|
a.src = g;
|
||||||
|
m.parentNode.insertBefore(a, m)
|
||||||
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
||||||
|
|
||||||
|
ga('create', '{{ $_ENV['ANALYTICS_KEY'] }}', 'auto');
|
||||||
|
ga('set', 'anonymizeIp', true);
|
||||||
|
|
||||||
|
@if (request()->invitation_key || request()->proposal_invitation_key || request()->contact_key)
|
||||||
|
ga('send', 'pageview', { 'page': '/client/portal' });
|
||||||
|
@else
|
||||||
|
ga('send', 'pageview');
|
||||||
|
@endif
|
||||||
|
|
||||||
|
function trackEvent(category, action) {
|
||||||
|
ga('send', 'event', category, action, this.src);
|
||||||
|
}
|
||||||
|
@else
|
||||||
|
function trackEvent(category, action) {
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
|
||||||
var NINJA = NINJA || {};
|
var NINJA = NINJA || {};
|
||||||
NINJA.fontSize = 9;
|
NINJA.fontSize = 9;
|
||||||
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
||||||
@ -287,45 +320,6 @@
|
|||||||
|
|
||||||
<body class="body">
|
<body class="body">
|
||||||
|
|
||||||
@if (request()->phantomjs)
|
|
||||||
<script>
|
|
||||||
function trackEvent(category, action) {
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@elseif (Utils::isNinjaProd() && isset($_ENV['ANALYTICS_KEY']) && $_ENV['ANALYTICS_KEY'])
|
|
||||||
<script>
|
|
||||||
(function (i, s, o, g, r, a, m) {
|
|
||||||
i['GoogleAnalyticsObject'] = r;
|
|
||||||
i[r] = i[r] || function () {
|
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
|
||||||
}, i[r].l = 1 * new Date();
|
|
||||||
a = s.createElement(o),
|
|
||||||
m = s.getElementsByTagName(o)[0];
|
|
||||||
a.async = 1;
|
|
||||||
a.src = g;
|
|
||||||
m.parentNode.insertBefore(a, m)
|
|
||||||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
|
||||||
|
|
||||||
ga('create', '{{ $_ENV['ANALYTICS_KEY'] }}', 'auto');
|
|
||||||
ga('set', 'anonymizeIp', true);
|
|
||||||
|
|
||||||
@if (request()->invitation_key || request()->proposal_invitation_key || request()->contact_key)
|
|
||||||
ga('send', 'pageview', { 'page': '/client/portal' });
|
|
||||||
@else
|
|
||||||
ga('send', 'pageview');
|
|
||||||
@endif
|
|
||||||
|
|
||||||
function trackEvent(category, action) {
|
|
||||||
ga('send', 'event', category, action, this.src);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@else
|
|
||||||
<script>
|
|
||||||
function trackEvent(category, action) {
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@yield('body')
|
@yield('body')
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user