Catch error on Google Analytics loading

This commit is contained in:
ErickSkrauch 2018-03-25 22:23:10 +03:00
parent fe9de056df
commit fb9f6e118e

View File

@ -65,7 +65,8 @@ function initAnalytics() {
if (window.GA_ID) { if (window.GA_ID) {
// when GA is not available, we will continue to push into array // when GA is not available, we will continue to push into array
// for debug purposes // for debug purposes
loadScript('https://www.google-analytics.com/analytics.js'); // Catch to prevent "unhandled rejection" error
loadScript('https://www.google-analytics.com/analytics.js').catch(() => {});
} }
ga('create', window.GA_ID, 'auto'); ga('create', window.GA_ID, 'auto');