-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gtm.js causes issues, cannot be filtered using denyUrls #9110
Comments
Hey there, could you maybe try adding the Maybe that can help adding more information to the captured frames. It's a bit hard to say what exactly gtm does, sadly...! |
We actually have |
I think the root issue here is that we have an issue in Next.js with the basePath setting in combination with source maps. If we fix that you can set inbound filters in the settings inside the SDK. |
We have a subpackage in a folder (an editor for a headless CMS) which is bundled into the main app. It has its own deps and we use an older version of lerna to make sure all the dependencies are met without conflict. |
I would guess the problem is (and you can kind of see this in the screenshot you posted) that the error originates in global code, not in the gtm.js file - the first frame shows this. 🤔 I guess one thing you could try is to set up a |
True, maybe GTM scripts of our clients just inject some other code directly into HTML and then they pose as normal Regardless, I'll add what you suggested, as a second layer of filtering.
I hope it helps. Thank you @mydea |
Closing this issue for clean-up. Please open a new issue if it still applies. Thanks! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.70.0
Framework Version
Next.js 12.3.4
Link to Sentry event
https://parfumado.sentry.io/issues/4503191085/?alert_rule_id=12596894&alert_type=issue¬ification_uuid=a57be758-fb1d-4930-be13-254321452057&project=4504049306435584&referrer=issue_alert-slack
SDK Setup
Relevant part from sentry.client.config.js
next.config.js
Steps to Reproduce
We have setup Sentry for our Next.js app and include Google Tag Manager in a <script>.
We add googletagmanager.com to the denyUrls, but we still get errors like "TypeError: undefined is not an object (evaluating 'a.N')", while there is no place in our code (but there is in gtm.js) that contains
a.N
.The stacktrace in Sentry then does not point to gtm.js, instead it thinks comes from our own app.
When I run
sentry-cli sourcemaps explain
for the event, it does flag that this comes from a script element:Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: