SDK Events
A comprehensive guide to the events posted by the Hubble SDK to the parent application.
The Hubble SDK can post events back to the parent application, allowing you to track user behavior and respond to actions within the gift card store. This is useful for analytics.
How to Listen for Events
To receive events from the SDK, you will need to register an event listener. Please refer to the platform-specific integration guides for detailed instructions on how to implement this.
Event Reference
The SDK emits various events with associated data. Below is a comprehensive list of events you can listen for.
Navigation Events
Note: All navigation events automatically include an isModal (boolean) property indicating whether the screen is displayed as a modal overlay. The properties listed below are additional to this standard property.
visit_home
Sent when the user visits the home screen.
Additional Properties: None
Example:
{ "isModal": false }visit_search
Sent when the user visits the search screen.
Additional Properties: None
Example:
{ "isModal": false }visit_category
Sent when a user visits a specific category page.
Additional Properties:
categoryName(required) - The name of the category visited
Example:
{ "categoryName": "FASHION", "isModal": false }visit_brand_l2
Sent when a user visits a specific brand’s page.
Additional Properties:
productId(required) - The unique product identifierbrandName(required) - The name of the brand viewedamount(required) - The selected voucher amount
Example:
{ "productId": "01VFBNDM43I2DHJSMCX", "brandName": "Amazon", "amount": 500, "isModal": false}visit_checkout_summary
Sent when the user visits the checkout summary screen.
Additional Properties:
brandName(required) - The brand being purchasedamount(required) - The transaction amountcouponCode(optional) - Applied coupon code if anyuseCoins(optional) - Whether coins are being useddiscount(optional) - Total discount amounthubbleBaseDiscount(optional) - Base discount from HubblecoinDiscount(optional) - Discount from coinscouponDiscount(optional) - Discount from coupon
Example:
{ "brandName": "Amazon", "amount": 500, "couponCode": "SAVE10", "useCoins": true, "discount": 150, "hubbleBaseDiscount": 50, "coinDiscount": 50, "couponDiscount": 50, "isModal": false}visit_voucher_edit_modal
Sent when the user opens the voucher amount/quantity edit modal.
Additional Properties:
productId(required) - The unique product identifierbrandName(optional) - The name of the brandquantity(optional) - Number of vouchers selectedamount(optional) - The selected voucher amount
Example:
{ "productId": "01VFBNDM43I2DHJSMCX", "brandName": "Amazon", "quantity": 1, "amount": 500, "isModal": true}Default Screen Visit Events
A generic visit_{screen_name} event is sent whenever a user navigates to any screen within the SDK that doesn’t have a dedicated event section above.
Common Properties:
All default screen visit events automatically include:
isModal(boolean) - Whether the screen is displayed as a modal overlay
Note: Screens with additional properties like visit_brand_l2, visit_checkout_summary, and visit_voucher_edit_modal are documented in the Navigation Events section above.
For example:
- Visiting the “Apply Coupons” screen sends
visit_couponswith{"isModal": true}if opened as a modal - Visiting the transactions screen sends
visit_transactionswith{"isModal": false}
Screen Names
The following are the possible values for {screen_name}:
Home & Menu:
homehome_menuiframe_modal
Authentication:
collect_phonecollect_otpcomplete_profile
Voucher Processing:
couponsvoucher_generation_successvoucher_generation_failvoucher_generation_loader
Payment Screens:
payment_loaderpayment_optionsinvoiceupi_id_inputpayment_status_polling
Transactions & History:
transactionstransaction_l2
Information Screens:
how_to_usetncwarning_modalbrand_unavailable_modalcategory_browsing_modal
Help & Support:
help_and_support
Phone Verification:
phone_collectionphone_otp_verification
Coins:
custom_coin_input_modalsee_why_coins_limit_modal
Bank Transfer:
bank_transferbank_how_to_transfer_modalbank_see_why_bs_modalbank_summary_transfer_modalbank_edit_amountbank_transfer_successbank_transfer_failbank_transfer_loaderbank_transfer_modebank_transfer_payoutsbank_transfer_high_waiting_time
Payment Events
payment_initiated
Sent when a payment is initiated by the user.
Properties:
brandName(required) - The brand being purchasedamount(required) - The payment amountpaymentMode(required) - The payment method (e.g., “UPI”, “CARD”)productId(required) - The unique product identifierconsumeCoins(optional) - Whether coins are being usedcouponCode(optional) - Applied coupon code if any
Example:
{ "brandName": "Amazon", "amount": 500, "paymentMode": "UPI", "productId": "01GMAVS2CHXR0XP1BZSTA9A44K"}payment_success
Sent when the payment gateway confirms payment success.
Properties:
amount(required) - The payment amountreferenceId(required) - The payment order reference IDprovider(required) - The payment provider (e.g., “RAZORPAY”)
Example:
{ "amount": 500, "referenceId": "ord_123", "provider": "RAZORPAY"}payment_fail
Sent when a payment fails at the gateway level.
Properties:
amount(required) - The payment amountreferenceId(required) - The payment order reference IDprovider(required) - The payment providerfailureReason(required) - The reason for payment failure
Example:
{ "amount": 500, "referenceId": "ord_123", "provider": "RAZORPAY", "failureReason": "Payment declined"}payment_upi_intent_triggered
Sent when a UPI intent is triggered to open a UPI app for payment.
Properties:
referenceId(required) - The payment order reference IDamount(required) - The payment amountupiApp(optional) - The name of the specific UPI app selected
Platform behavior:
iOS:
The SDK displays a custom selection modal for UPI app selection. When the user selects a specific UPI app from this list, the upiApp property is included in the event.
Android:
The SDK triggers Android’s built-in system modal for UPI app selection. Since the app selection is handled by the system and not the SDK, the upiApp property is not available and will not be sent. Only referenceId and amount are included.
Example:
{ "upiApp": "GPAY", "amount": 500, "referenceId": "ord_123"}Possible upiApp values (iOS only):
| Value | UPI App |
|---|---|
PhonePe | PhonePe |
PayTM | Paytm |
GPAY | Google Pay |
CRED | CRED |
click_payment_cancel
Sent when a user clicks the cancel/close button during an active payment flow.
Properties:
- referenceId (required) - The payment order reference ID
- amount (required) - The payment amount
- paymentStatus (required) - The current payment order status
- provider (optional) - The payment provider (e.g., “RAZORPAY”)
Example:
{ "referenceId": "ord_123", "amount": 500, "paymentStatus": "ACTIVE", "provider": "RAZORPAY"}Voucher Events
voucher_generation_processing
Sent when the order status is “ACTIVE” and voucher generation is in progress. This indicates the system is processing the order and generating vouchers after payment confirmation. The order will eventually resolve to either voucher generation success or failure.
Properties:
amount(required) - The order amountreferenceId(required) - The order reference IDprovider(required) - The payment provider (e.g., “RAZORPAY”, “PAYU”)paymentMode(optional) - The payment method used (e.g., “UPI_INTENT”, “CARD”)
Example:
{ "amount": 500, "referenceId": "ord_123", "provider": "RAZORPAY", "paymentMode": "UPI_INTENT"}voucher_generation_success
Sent when voucher(s) are successfully generated after payment.
Properties:
brandName(required) - The brand for which vouchers were generatedamount(required) - The total voucher amountvouchersCount(required) - The number of vouchers generated
Example:
{ "brandName": "Amazon", "amount": 500, "vouchersCount": 1}voucher_generation_fail
Sent when voucher generation fails after payment.
Properties:
brandName(required) - The brand for which voucher generation was attemptedamount(required) - The attempted voucher amountvouchersCount(required) - The number of vouchers attemptedorderId(required) - The order ID for reference
Example:
{ "brandName": "Amazon", "amount": 500, "vouchersCount": 1, "orderId": "ord_123"}User Interaction Events
search_query
Sent whenever the user types in the search field.
Properties:
query(required) - The search query text
Example:
{ "query": "amazon card" }banner_clicked
Sent when the user clicks on a promotional banner.
Properties:
bannerId(required) - The unique identifier of the bannerbannerType(required) - The type of banner (e.g., “PROMOTIONAL”, “OFFER”)bannerUrl(optional) - The URL the banner links to
Example:
{ "bannerId": "banner_123", "bannerType": "PROMOTIONAL", "bannerUrl": "https://example.com/offer"}coin_payment
Sent when the entire payment is made using only coins (no actual payment gateway involved).
Properties:
amount(required) - The total amountcoins(required) - Number of coins usedbaseDiscount(required) - Base discount appliedcouponDiscount(required) - Coupon discount appliedtotalDiscount(required) - Total discount amount
Example:
{ "amount": 500, "coins": 10, "baseDiscount": 100, "couponDiscount": 50, "totalDiscount": 150}Error Events
init_error
Sent when the SDK fails to initialize properly.
Properties:
error(required) - The error object or message describing the initialization failure
Example:
{ "error": "Failed to load configuration"}auth_error
Sent when authentication fails or the user’s session has expired.
Properties:
error(required) - Description of the authentication error
Example:
{ "error": "Invalid session or session has expired"}unexpected_error
Sent when an unexpected error occurs during the transaction flow.
Properties:
brandName(optional) - The brand being purchasedamount(optional) - The transaction amountreason(required) - Description of the errorerrorType(optional) - Categorization of the error typepaymentMode(optional) - The payment method being usedorderId(optional) - The order ID if available
Example:
{ "brandName": "Amazon", "amount": 500, "reason": "Failed to create payment order", "errorType": "REDEMPTION_INIT_FAILED", "paymentMode": "UPI"}Session Events
exited
Sent when the user exits or closes the SDK.
Properties:
through(optional) - How the user exited (e.g., “home_back_button”)
Example:
{ "through": "home_back_button"}