Manual Button Taps
While Button Auto Capture automatically detects taps on native buttons, our SDK also offers an option to manually report button taps, which is useful in the following scenarios:
- Reporting taps on controls that are not covered by Button Auto Capture, e.g. SwiftUI buttons (iOS) or Jetpack Compose buttons (Android).
- Reporting button taps in React Native, where native Button Auto Capture does not apply because the UI is not rendered as native views.
- Supplementing Button Auto Capture with additional button reporting.
- Reporting button taps when Button Auto Capture is disabled.
Add Reporting Code
You can manually report a button tap using a dedicated SDK method by providing the identifier of the tapped button. Learn more about available methods in the API Reference.
Code Examples
- iOS
- Android
- React Native
import QualtricsExperience
Button("Checkout") {
Qualtrics.reportButtonTap("checkout_button")
// ...
}
checkoutButton.setOnClickListener {
Qualtrics.reportButtonTap("checkout_button")
// ...
}
import { reportButtonTap } from '@qualtrics-experience/core';
<Button
title="Checkout"
onPress={() => {
reportButtonTap("checkout_button");
// ...
}}
/>