Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I am using custom pixel of shopify to load sentry script in shopify based on customer preference options.
my custom pixel code -
// Dynamically load the Sentry script var script = document.createElement("script"); script.src="https://example.min.js/ // sentry cdn"; script.crossOrigin = "anonymous"; script.onload = function () { // Initialize Sentry once the script is loaded window.sentryOnLoad = function () { Sentry.init({ integrations: [ Sentry.replayIntegration({ maskAllText: false, blockAllMedia: false, }), ], ignoreErrors: [ /gmo/i, /Non-Error promise rejection captured/i, /Failed to fetch/i, /Network Error/i, /Load failed/i, /Access is denied/i, /Could not establish connection/i, /UnhandledRejection/i, /Object captured as promise rejection with keys/i, /The play\(\)/i, /Unable to export metrics/i, /The operation was aborted/i, /Network request failed/i, /captured as promise rejection/i, /XMLHttpRequestProgressEvent/i, /is not valid JSON/i, /Error completing request/i, /Failed to read the/i, /ResizeObserver loop/i, /load error:/i, /Unexpected token '.'/i, /ProgressEvent/i, /validation failed/i, /AxiosError/i, /SyntaxError: Unexpected end of JSON input/i, /ResizeObserver loop limit exceeded/i, /NotFoundError/i, /IDBDatabase/i, /CustomEvent/i, /cross-origin/i, /The operation is insecure/i, ], beforeSend(event) { const ignoreErrors = [ "gmo", "Non-Error promise rejection captured", "Failed to fetch", "Network Error", "Load failed", "Access is denied", "Could not establish connection", "UnhandledRejection", "Object captured as promise rejection with keys", "The play()", "Unable to export metrics", "The operation was aborted.", "Network request failed", "captured as promise rejection", "XMLHttpRequestProgressEvent", "is not valid JSON", "Error completing request", "Failed to read the", "ResizeObserver loop", "load error:", "Unexpected token '.'", "ProgressEvent", "validation failed", "AxiosError", "SyntaxError: Unexpected end of JSON input", "ResizeObserver loop limit exceeded", "NotFoundError", "IDBDatabase", "CustomEvent", "cross-origin", "The operation is insecure", ]; if ( event.message && ignoreErrors.some((error) => event.message.includes(error) ) ) { return null; } if (event.user) { delete event.user.email; // Mask sensitive info } return event; }, }); }; }; // Append the Sentry script to the head document.head.appendChild(script);
These sentry loader script is working. sentry js is loading on site but i am facing warning in my console ->
So please check and inform me that if this warning will affect on sentry core functionality.
Thank you!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025