Use Autocapture to get fast insights

Amplitude's Autocapture is the best option for getting up and running quickly. This document helps you enable Autocapture across your digital products for out of the box analytics with minimal engineering.

Autocapture for the web

Starting with version 2.10.0, the Amplitude Browser SDK includes Autocapture to help you capture events, interactions, and attribution on your site.

Install the Browser SDK

To get started with Autocapture, install the latest version of the Browser SDK (2.11.9) with the unified script loader, npm, or yarn.

1<script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
2<script>
3 window.amplitude.init('AMPLITUDE_API_KEY', {
4 "fetchRemoteConfig":true, "autocapture":true
5 });
6</script>

1npm install @amplitude/analytics-browser

1yarn add @amplitude/analytics-browser

Initialize the SDK

Browser SDK 2.10.0 and above includes element click and change tracking, which enables visual labeling within Amplitude. To enable it, make sure config.autocapture.elementInteractions is set to true when initializing the SDK.

Autocapture ships with Browser SDK 2.10.0 and above. To enable it, set config.autocapture.elementInteractions to true when initializing the SDK.

No extra initialization required.

1import * as amplitude from '@amplitude/analytics-browser';
2import { autocapturePlugin } from '@amplitude/plugin-autocapture-browser';
3 
4amplitude.init('AMPLITUDE_API_KEY', {
5 autocapture: {
6 elementInteractions: true
7 }
8});

Content security policy (CSP)

If your web app configures the strict Content Security Policy (CSP) for security concerns, adjust the policy to allowlist to Amplitude domains:

  • Add https://*.amplitude.com to script-src
  • Add https://*.amplitude.com to connect-src

Events

Event Description Properties
Page viewed Captures when a user loads a page on your site. Page counter, Page domain, Page location, Page path, Page title, Page URL, Session Replay ID (if enabled), Referrer, Attribution, User properties.
Start session Captures when a user starts a session on your site. Session Replay ID (if enabled), User properties.
End session Captures when a user ends a session on your site. User properties.
Form started Captures when a user interacts with a form on your site. Form destination, Session Replay ID (if enabled), User properties.
Form submitted Captures when a user submits a form on your site. Form destination, Session Replay ID (if enabled), User properties.
File downloaded Captures when a user downloads a file from your site. File extension, File name, Link text, Link URL, Session Replay ID (if enabled),
Element clicked Captures when a user clicks an element on the page. Element Aria Label, Element Class, Element Hierarchy, Element Href, Element ID, Element Parent Label, Element Position Left, Element Position Top, Element Selector, Element Tag, Element Text, Page Title, Page URL, Session Replay ID, Viewport Height, Viewport Width.
Element changed Captures form element interactions, such as changes a dropdown or inputs text into a text box. Element Class, Element Hierarchy, Element ID, Element Parent Label, Element Position Left, Element Position Top, Element Tag, Page Title, Page URL, Session Replay ID, Viewport Height, Viewport Width.

For more information, see Autocapture in the Browser SDK 2 documentation.

Default event prefix

Amplitude prefixes Autocapture events with the Amplitude logo.

Marketing attribution

Captures the following properties:

User properties

Amplitude attaches User Properties to all Autocapture events, unless disabled.

Visual labeling for web

Amplitude's visual labeling tool enables you to identify and select individual elements on a page that you want to track. For example, if you want to track the number of users who click a Sign up, button you can select it with visual labeling, and Amplitude creates an event that targets the specific element.

Events you add with visual labeling work retroactively, since Amplitude captures all form-related events starting from when your instrumentation is live.

For more information, see Visual labeling.

Autocapture for iOS

The latest version of Amplitude's iOS SDK includes Autocapture capabilities.

Install the SDK

Install the SDK as instructed in the iOS-Swift SDK documentation.

Initialize the SDK with Autocapture enabled

The iOS SDK enables session tracking, and disables application lifecycle, screen view, and element interaction tracking by default. To enable all Autocapture capabilities, initialize the SDK with the following snippet:

1let amplitude = Amplitude(configuration: Configuration(
2 apiKey: "API_KEY",
3 autocapture: [.sessions, .appLifecycles, .screenViews, .elementInteractions]
4))

1AMPConfiguration* configuration = [AMPConfiguration initWithApiKey:@"API_KEY"];
2configuration.autocapture = [[AMPAutocaptureOptions alloc] initWithOptionsToUnion:@[
3 AMPAutocaptureOptions.sessions,
4 AMPAutocaptureOptions.appLifecycles,
5 AMPAutocaptureOptions.screenViews,
6 AMPAutocaptureOptions.elementInteractions
7]];
8Amplitude* amplitude = [Amplitude initWithConfiguration:configuration];

Autocapture events

Event Description Properties
Start session Captures when a user starts a session in your app. User properties.
End session Captures when a user ends a session in your app. User properties.
Application installed Captures when a user opens the app for the first time after they install it.
Application updated Captures when a user opens the app for the first time after they update it.
Application opened Captures when a user launches or foregrounds the app after the first open.
Application backgrounded Captures when a user backgrounds the application.
Screen viewed Captures when a user views a screen in your app. Screen name
Element Interacted Captures when a user interacts with the UI elements in your app. Element properties

User properties

Amplitude attaches User Properties to all Autocapture events, unless disabled.

Autocapture for Android

The latest version of Amplitude's Android SDK includes Autocapture capabilities.

Install the SDK

Install the SDK as instructed in the Android-Kotlin SDK documentation.

Initialize the SDK with Autocapture enabled

The Android-Kotlin SDK enables session tracking, and disables application lifecycle, screen view, deep link, and element interaction tracking by default. To enable all Autocapture capabilities, initialize the SDK with the following snippet:

1Amplitude(
2 Configuration(
3 apiKey = AMPLITUDE_API_KEY,
4 context = applicationContext,
5 autocapture = autocaptureOptions {
6 +sessions // or `+Autocapture.SESSIONS`
7 +appLifecycles // or `+Autocapture.APP_LIFECYCLES`
8 +deepLinks // or `+Autocapture.DEEP_LINKS`
9 +screenViews // or `+Autocapture.SCREEN_VIEWS`
10 +elementInteractions // or `+Autocapture.ELEMENT_INTERACTIONS`
11 }
12 )
13)

1Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
2configuration.getAutocapture().addAll(Arrays.asList(
3 AutocaptureOption.APP_LIFECYCLES,
4 AutocaptureOption.DEEP_LINKS,
5 AutocaptureOption.SCREEN_VIEWS,
6 AutocaptureOption.ELEMENT_INTERACTIONS
7));
8 
9Amplitude amplitude = new Amplitude(configuration);

Autocapture events

Event Description Properties
Start session Captures when a user starts a session in your app. User properties.
End session Captures when a user ends a session in your app. User properties.
Application installed Captures when a user opens the app for the first time after they install it.
Application updated Captures when a user opens the app for the first time after they update it.
Application opened Captures when a user launches or foregrounds the app after the first open.
Application backgrounded Captures when a user backgrounds the application.
Screen viewed Captures when a user views a screen in your app. Screen name
Deep link opened Captures when a user opens a deep link in your app. URL and referrer information
Element Interacted Captures when a user interacts with the UI elements in your app. Element properties

User properties

Amplitude attaches User Properties to all Autocapture event, unless disabled.

Was this page helpful?

Thanks for your feedback!

August 1st, 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.