Remove broken sessionReplay code - #25
Merged
Merged
Conversation
williamw
approved these changes
Aug 19, 2026
| @@ -32,12 +32,6 @@ export function initExperiment() { | |||
| } | |||
|
|
|||
| waitUntil(() => window.amplitude).then(() => { | |||
Contributor
There was a problem hiding this comment.
Will this just cause a timeout on every page if the user declined cookies?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the Webflow custom code that used to define
window.sessionReplaywas removed in favor of GTM-managed init, a leftover call insrc/tracking/experiment.jsthrowsTypeError: Cannot read properties of undefined (reading 'plugin')on every page load, which lines up with the ~98% drop in[Amplitude] Page Viewedevents onwww.modular.comsince July 24–25.Changes in this PR:
window.sessionReplay.plugin(...)call fromsrc/tracking/experiment.jswindow.amplitude.init(...)call from the same block (GTM now owns init, gated on consent)initAmplitude()insrc/tracking/amplitude.jsuntouched — it only calls.track()and is safe either waydist/Next steps to confirm the fix:
.pluginTypeError — should be gonewindow.amplitude._iqpopulates on page load with consent granted (was still empty as of the last GTM-side check)POSTto Amplitude's collection endpoint appears in the Network tab{{Amplitude Config}}GTM variable (currently aConstant, should beCustom JavaScript)