<script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
My current setup is:
The docs are basically non existent for this SDK: “https://cdn.amplitude.com/libs/analytics-browser-2.9.0-min.js.gz”
Hi
Thanks for flagging this. You can run Session Replay without Autocapture; the issue in your snippet is the config name for your SDK version. In analytics-browser 2.9.0 the switch is defaultTracking (not autocapture). Either upgrade to 2.10.0+ and use autocapture, or keep 2.9.0 and set defaultTracking to disable the auto events while still allowing Session Replay. (Migrate from Browser SDK 1.0 to 2.0, Browser SDK 2 | Amplitude)
If you stay on 2.9.0, use the third init argument for options and keep sessions on so replays link to sessions:
script src="https://cdn.amplitude.com/libs/analytics-browser-2.9.0-min.js.gz"</script> script src="https://cdn.amplitude.com/libs/plugin-session-replay-browser-1.4.0-min.js.gz"</script> <script> const sessionReplayTracking = window.sessionReplay.plugin({ sampleRate: 0.1 }); window.amplitude.add(sessionReplayTracking); window.amplitude.init("API_KEY", undefined, { defaultTracking: { attribution: false, pageViews: false, sessions: true, formInteractions: false, fileDownloads: false, elementInteractions: false, }, }); </script>
On 2.10.0+ you can use autocapture and turn everything off with one line:
amplitude.init("API_KEY", { autocapture: false });
Both options are documented in the Browser SDK reference; Session Replay works with the Browser SDK and doesn’t require Autocapture, but it does rely on sessions (the plugin enables session tracking by default). (Browser SDK 2 | Amplitude, Session Replay Browser SDK Plugin).
Lastly, the “Data > Settings > Autocapture” UI toggle only affects SDKs that support remote config. Remote config support starts at 2.10.0; 2.9.0 won’t pick up those UI changes, which is why the setting didn’t help. (Browser SDK 2 | Amplitude)
Hope this unblocks you!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. Want to sign up as a guest? Create a Community account.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.