AMP-Analytics: Errors with Google Tag-Manager
See original GitHub issueWhat’s the issue?
A change made in the following PR is resulting in the __amp_source_origin
to be excluded from requests to an amp-analytics config file.
https://github.com/ampproject/amphtml/pull/12787
Google Tag Manager appears to omit all CORS headers unless this GET parameter is included.
Because Access-Control-Allow-Origin: *
is therefore not included by GTM, the browser throws the following error:
Failed to load https://www.googletagmanager.com/amp.json?id=GTM-KCTM85F>m.url=https%3A%2F%2Fwww.simgolf.dk%2F: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://www.simgolf.dk’ is therefore not allowed access. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
How do we reproduce the issue?
One example provided in the #general Slack channel was for https://www.simgolf.dk/
What browsers are affected?
I am assuming all.
Which AMP version is affected?
The latest build: https://github.com/ampproject/amphtml/releases/tag/1516396600278
Issue Analytics
- State:
- Created 6 years ago
- Comments:31 (17 by maintainers)
Maybe it’s a silly question but, have you published your GTM container?
I’m experiencing the same issue, even though it was said that the fix has been released. Do I need to change something in Google Tag Manager configuration?