Shopify custom pixel and its sandbox environment

Shopify custom pixel and its sandbox environment

Khushboo4
Shopify Partner
2 0 0

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 ->

modern/:7 In a sandboxed environment, addEventListener may not behave as expected.

 



So please check and inform me that if this warning will affect on sentry core functionality.

Thank you!

Replies 0 (0)