Several of our analytics scripts stop loading.
if (window.crossOriginIsolated)
script.setAttribute('crossorigin', 'anonymous')
Which worked for the tags that get loaded directly by analytics-next
.
Unfortunately for some scripts, like Amplitude
, it looks like they load a script that injects another script which doesn't have the crossorigin
attribute & so fails to load.
I was able to set a breakpoint in the debugger & manually inject the attribute:
to verify that this fixes the issue:
But have no way to actually edit the code coming down from this URL https://cdn.segment.com/next-integrations/integrations/amplitude/3.3.3/amplitude.dynamic.js.gz
to persist the change.
Could someone at Segment update those remote scripts to inject crossorigin="anonymous"
on tags they're adding when window.crossOriginIsolated
is true
? Besides Amplitude
, it looks like the other integrations we have that are failing are gtag
, reddit
and LinkedIn
.