Skip to content
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

Autocapture ElementInteractions does not log which alert/action sheet button was pressed #254

Open
MichaelLHerman opened this issue Jan 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@MichaelLHerman
Copy link

Expected Behavior

Autocapture ElementInteractions identifies which button was pressed through its accessibilityIdentifier. For action sheets and alerts I would expect the button text to be logged to be able to identify what the user action was. This is especially important if the button action does not result in a UI change that would be captured through autocapture (e.g. action button does not navigate to a different screen than the the cancel action button).

Current Behavior

Action sheet logged with title but without clicked button's text:

  "event_properties": {
    "[Amplitude] Action": "longPress",
    "[Amplitude] Gesture Recognizer": "UILongPressGestureRecognizer",
    "[Amplitude] Hierarchy": "_UIAlertControllerInterfaceActionGroupView → UIView → _UIAlertControllerPhoneTVMacView → UITransitionView → UIWindow",
    "[Amplitude] Screen Name": "What would you like to do?",
    "[Amplitude] Target View Class": "_UIAlertControllerInterfaceActionGroupView"
  },

Same behavior for Alert - logged with title but without clicked button's text:

  "display_name": "[Amplitude] Element Interacted",
  "event_id": 703,
  "event_properties": {
    "[Amplitude] Action": "longPress",
    "[Amplitude] Gesture Recognizer": "UILongPressGestureRecognizer",
    "[Amplitude] Hierarchy": "_UIAlertControllerInterfaceActionGroupView → UIView → _UIAlertControllerPhoneTVMacView → UITransitionView → UIWindow",
    "[Amplitude] Screen Name": "Delete Sign Out",
    "[Amplitude] Target View Class": "_UIAlertControllerInterfaceActionGroupView"
  },
  "event_time": "2025-01-13 18:33:18.869000",
  "event_type": "[Amplitude] Element Interacted",

Possible Solution

Steps to Reproduce

  1. Configure Amplitude with autocapture: .elementInteractions
  2. Create an alert and an action sheet with multiple buttons
  3. Run app, click action to show alert/action sheet. Click buttons on alert/action sheet.
  4. Review Amplitude Live View

Environment

  • SDK Version: 1.11.2
  • OS Info: iPhone 15 Pro iOS 18.1 Simulator (Xcode 16.2)
@MichaelLHerman MichaelLHerman added the bug Something isn't working label Jan 13, 2025
@crleona crleona added enhancement New feature or request and removed bug Something isn't working labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants