Autocapture Plugin
Autocapture plugin is deprecated
Starting with Browser SDK version 2.10.0, Amplitude includes Autocapture functionality with the SDK.
For best results, upgrade to Browser SDK 2.10.0 or higher using the following instructions.
Update to the built-in Autocapture
If you use the Autocapture plugin and update the Browser SDK to version 2.10.0 or newer, complete the following steps to remove the plugin and use the Autocapture that ships with Browser SDK.
Script loader
Replace your referenced script with the following snippet:
html
<script src="https://cdn.amplitude.com/libs/analytics-browser-{{sdk_versions.browser}}-min.js.gz"></script>
<script>
window.amplitude.init("AMPLITUDE_API_KEY", {
autocapture: { elementInteractions: true },
});
</script>
Npm or yarn
If you use npm or yarn to add the Browser SDK, update the Browser SDK package and remove the Autocapture plugin.
js
// package.json
{
"dependencies": {
"@amplitude/analytics-browser": "^2.10.0", // make sure the minimum version is 2.10.0
"@amplitude/plugin-autocapture-browser": "0.9.0",
}
}
In your script, remove references to the Autocapture plugin.
js
import * as amplitude from "@amplitude/analytics-browser";
import { autocapturePlugin } from "@amplitude/plugin-autocapture-browser";
amplitude.init(AMPLITUDE_API_KEY);
amplitude.init(AMPLITUDE_API_KEY, {
autocapture: {
elementInteractions: true,
},
});
amplitude.add(autocapturePlugin());
Was this helpful?