Files
kupshop/web/common/templates/block.sentry.tpl
2025-08-02 16:30:27 +02:00

83 lines
2.8 KiB
Smarty

{if $dbcfg.sentry_monitoring == 'Y'}
<script src="{static_url url="/common/static/js/sentry-7.85.0.tracing.min.js"}"></script>
<script>
Sentry.init({
dsn: 'https://5fd110d7c17a2b186a776b82ca6df945@sentry.wpj.cz/15',
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 1.0,
environment: "{substr(getShopName(), 5)}",
allowUrls: [
/{$cfg.Addr.print|replace:'.':'\.'|replace:'/':'\/'}/
],
beforeSend(event) {
if (!/FBA[NV]|PhantomJS|SznProhlizec/.test(window.navigator.userAgent)) {
return event;
}
},
ignoreErrors: [
]
});
{get_symfony_request assign='symfony_request'}
Sentry.addEventProcessor(function(event) {
event.transaction = "{join('|', $symfony_request->attributes->get('wpj_transaction', []))}";
return event;
});
Sentry.setTag("web", "{getShopName()}");
Sentry.setTag("adm", {if getAdminUser()}1{else}0{/if});
Sentry.setTag("tpl", "{if $cfg.Path.smarty_tpl.theme == "koza"}e{elseif $cfg.Path.smarty_tpl.theme == "elnino"}el{else}{$cfg.Path.smarty_tpl.theme[0]}{/if}");
</script>
{else}
<script src="{static_url url="/common/static/js/sentry-6.16.1.min.js"}"></script>
<script>
Sentry.init({
dsn: 'https://bdac53e35b1b4424b35eb8b76bcc2b1a@sentry.wpj.cz/9',
allowUrls: [
/{$cfg.Addr.print|replace:'.':'\.'|replace:'/':'\/'}/
],
denyUrls: [
// Facebook flakiness
/graph\.facebook\.com/i,
// Facebook blocked
/connect\.facebook\.net\/en_US\/all\.js/i,
// Chrome extensions
/extensions\//i,
/^chrome:\/\//i,
/kupshop\.local/i
],
beforeSend(event) {
if (!/FBA[NV]|PhantomJS|SznProhlizec/.test(window.navigator.userAgent)) {
return event;
}
},
ignoreErrors: [
// facebook / ga + disabled cookies
'fbq is not defined',
'Can\'t find variable: fbq',
'_gat is not defined',
'AW is not defined',
'Can\'t find variable: AW',
'url.searchParams.get', // gtm koza
// localstorage not working in incoginto mode in iOS
'The quota has been exceeded',
'QuotaExceededError',
'Undefined variable: localStorage',
'localStorage is null',
'The operation is insecure',
"Failed to read the 'localStorage'",
"gtm_",
"Can't find variable: glami",
]
});
Sentry.setTag("web", "{substr($cfg['Connection']['database'], 8)}");
Sentry.setTag("wbpck", {if $cfg.Modules.webpack}1{else}0{/if});
Sentry.setTag("adm", {if getAdminUser()}1{else}0{/if});
Sentry.setTag("tpl", "{if $cfg.Path.smarty_tpl.theme == "koza"}e{elseif $cfg.Path.smarty_tpl.theme == "elnino"}el{else}{$cfg.Path.smarty_tpl.theme[0]}{/if}");
Sentry.setTag("sentry_v", "6.16.1");
</script>
{/if}