-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add autocapture for element clicks #199
feat: add autocapture for element clicks #199
Conversation
android/src/main/java/com/amplitude/android/internal/locators/AndroidViewTargetLocator.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/amplitude/android/plugins/AndroidLifecyclePlugin.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/amplitude/android/utilities/DefaultEventUtils.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @PouriaAmini the PR looks great.
I think we should do some testing in the wild with a small group of customers before enabling by default in production. Can you please make this feature (temporary) opt-in only?
android/src/main/java/com/amplitude/android/DefaultTrackingOptions.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @PouriaAmini. LGTM. I noticed the build/tests are falling though.
# Conflicts: # gradle/wrapper/gradle-wrapper.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Pouria for adding element clicks autocaputre and using @ExperimentalAmplitudeFeature
.
# [1.17.0](v1.16.8...v1.17.0) (2024-08-08) ### Bug Fixes * extract ComposeUtils to share with plugins ([#202](#202)) ([c239bba](c239bba)) * fix release pipeline ([#211](#211)) ([816599f](816599f)) * revert autocapture scroll and swipe ([#206](#206)) ([4b834bd](4b834bd)) ### Features * add autocapture for element clicks ([#199](#199)) ([7f0a500](7f0a500)) * add autocapture in configs ([#207](#207)) ([dcb9393](dcb9393)) * add screen name to elementInteractions properties for autocapture ([#209](#209)) ([8044122](8044122)) * add scroll and swipe autocapture ([#201](#201)) ([1a5a392](1a5a392))
Summary
This PR removes support for Android SDKs 18 and below.
This PR adds the Autocapture feature to enable automatically tracking clicks on clickable element for the legacy Android View system and Jetpack Compose. This functionality is available to both new and existing users but is disabled by default. To enable it, set
userInteractions
inDefaultTrackingOptions
totrue
:Note: To use this feature, the
@OptIn(ExperimentalAmplitudeFeature::class)
is required to be added to the scope of the instance initialization, Activity class definition, or the entire file or module.New automatically captured event
[Amplitude] Element Clicked
: Emitted when a user clicks on a clickable element in the legacy Android View system or a tagged clickable@Composable
functions in Compose.Note: To capture the event in Compose, the clickable
@Composable
functions must include aModifier.testTag
, otherwise the event will not be captured. Clickable@Composable
functions have anOnClick
lambda or aModifier.clickable
modifier (for Jetpack Compose > 1.5).New automatically captured properties
[Amplitude] Element Class
: (Android Views only) The canonical name of the underlying class of the clickable element, or the simple name as given in the source code if the canonical name is unavailable.[Amplitude] Element Resource
: (Android Views only) The entry name for the resource identifier of the clicked element.[Amplitude] Element Tag
: (Compose only) TheModifier.testTag
specified for the clicked @composable function.[Amplitude] Element Source
: (Android Views and Compose) The type of the origin of the clicked element, either "Android Views" for legacy Android Views or "Jetpack Compose" for Compose.Checklist