Starting with Browser SDK version 2.10.0, Amplitude includes Autocapture functionality with the SDK.
For best results, Amplitude recommends that you upgrade to Browser SDK 2.10.0 or higher using the following instructions.
If you used the Autocapture plugin, and updated the Browser SDK to version 2.10.0 or newer, complete the following steps to remove the plugin, and used the Autocapture that ships with Browser SDK.
Replace your referenced script with the following snippet:
1<script src="https://cdn.amplitude.com/libs/analytics-browser-2.11.7-min.js.gz"></script>2<script>3 window.amplitude.init("AMPLITUDE_API_KEY", {4 autocapture: { elementInteractions: true }5 });6</script>
If you use npm or yarn to add the Browser SDK, update the Browser SDK package, and remove the Autocapture plugin.
1// package.json2{3 "dependencies": {4 "@amplitude/analytics-browser": "^2.10.0", // make sure the minimum version is 2.10.0- "@amplitude/plugin-autocapture-browser": "0.9.0", 6 }7}
In your script, remove references to the Autocapture plugin.
1import * as amplitude from '@amplitude/analytics-browser'; -import { autocapturePlugin } from '@amplitude/plugin-autocapture-browser'; 3 -amplitude.init(AMPLITUDE_API_KEY); +amplitude.init(AMPLITUDE_API_KEY, { 6 autocapture: { 7 elementInteractions: true, 8 }, 9}); -amplitude.add(autocapturePlugin());
Thanks for your feedback!
June 17th, 2024
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.