Skip to content

Instantly share code, notes, and snippets.

@nautilytics
Last active March 17, 2026 15:06
Show Gist options
  • Select an option

  • Save nautilytics/dc8060830356a43acfc664b2e7befb13 to your computer and use it in GitHub Desktop.

Select an option

Save nautilytics/dc8060830356a43acfc664b2e7befb13 to your computer and use it in GitHub Desktop.

Instant Issuance Tracking Events

All events use feature: "Instant Issuance" and are sent via the V2 tracking system.

1. Eligibility API Success

Fires when: The eligibility API returns successfully (no error)

{
  "name": "Eligibility",
  "component": "API",
  "action": "Success",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {
    "assignment": "TEST | CONTROL | null",
    "eligible": true
  },
  "expoUpdatesData": {}
}

2. Eligibility API Error

Fires when: The eligibility API returns an error (hasError: true)

{
  "name": "Eligibility",
  "component": "API",
  "action": "Fail",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {
    "assignment": null,
    "eligible": false,
    "technicalMessage": "Instant issuance eligibility API error",
    "expected": true
  },
  "expoUpdatesData": {}
}

3. Banner Viewed

Fires when: User is eligible and the banner is displayed

{
  "name": "Instant Issuance Banner",
  "component": "Banner",
  "action": "View",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {},
  "expoUpdatesData": {}
}

4. Add to Apple Wallet Click (iOS)

Fires when: User taps the Add to Apple Wallet button

{
  "name": "Add to Apple Wallet",
  "component": "Button",
  "action": "Click",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {},
  "expoUpdatesData": {}
}

5. Add to Google Wallet Click (Android)

Fires when: User taps the Add to Google Wallet button

{
  "name": "Add to Google Wallet",
  "component": "Button",
  "action": "Click",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {},
  "expoUpdatesData": {}
}

6. Wallet Provisioning Success (iOS)

Fires when: Card is successfully added to Apple Wallet

{
  "name": "Wallet Provisioning",
  "component": "API",
  "action": "Success",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {
    "walletType": "apple"
  },
  "expoUpdatesData": {}
}

7. Wallet Provisioning Success (Android)

Fires when: Card is successfully added to Google Wallet

{
  "name": "Wallet Provisioning",
  "component": "API",
  "action": "Success",
  "location": "Account",
  "feature": "Instant Issuance",
  "platform": "App",
  "sessionId": "<uuid>",
  "ecsAccountId": null,
  "ecsCustomerId": null,
  "isErrorMessage": false,
  "metadata": {
    "walletType": "google"
  },
  "expoUpdatesData": {}
}

Notes

  • location is auto-derived from the current route name (typically "Account")
  • sessionId is a UUID generated per app session
  • expoUpdatesData contains OTA update metadata (channel, updateId, etc.)
  • Events are gated by the event-schema-v-2-enabled LaunchDarkly flag
  • Events are sent to both Segment and FullStory (FullStory uses a concatenated event name)

Instant Issuance Tracking Events

This document describes the Segment tracking events for the Instant Issuance feature in the card-dashboard web application.

Overview

All events use the V2 tracking system and share the following common properties:

Property Value Description
feature InstantIssuance Feature identifier from Feature enum
location Auto-derived Derived from current URL pathname
platform web Platform identifier
sessionId Auto-generated Segment session ID

Events

1. Eligibility API Success

Fired when the instant issuance eligibility API call completes successfully (regardless of eligibility result).

Property Value
name Eligibility
component API
action Success

Metadata:

Field Type Description
assignment string | null LaunchDarkly A/B test assignment (e.g., "CONTROL", "TEST"). Only populated when eligible.
eligible boolean Whether the user is eligible for instant issuance

Example payload:

{
  "name": "Eligibility",
  "component": "API",
  "action": "Success",
  "feature": "InstantIssuance",
  "metadata": {
    "assignment": "TEST",
    "eligible": true
  }
}

2. Eligibility API Error

Fired when the instant issuance eligibility API call fails or returns an error.

Property Value
name Eligibility
component API
action Fail
isErrorMessage true

Metadata:

Field Type Description
assignment string | null LaunchDarkly assignment (typically null on error)
eligible boolean Always false on error
displayMessage string Customer-facing error message (empty string - no UI shown)
technicalMessage string Technical error description
expected boolean Whether this error is expected behavior

Example payload:

{
  "name": "Eligibility",
  "component": "API",
  "action": "Fail",
  "feature": "InstantIssuance",
  "isErrorMessage": true,
  "metadata": {
    "assignment": null,
    "eligible": false,
    "displayMessage": "",
    "technicalMessage": "Instant issuance eligibility API returned error",
    "expected": true
  }
}

3. Instant Issuance Kard View

Fired when the Instant Issuance promotional card (kard) is displayed to an eligible user.

Property Value
name Instant Issuance Kard
component Banner
action View

Example payload:

{
  "name": "Instant Issuance Kard",
  "component": "Banner",
  "action": "View",
  "feature": "InstantIssuance"
}

4. App Store Link Click (iOS)

Fired when user clicks the "Download on App Store" badge.

Property Value
name Download on App Store
component Link
action Click

Example payload:

{
  "name": "Download on App Store",
  "component": "Link",
  "action": "Click",
  "feature": "InstantIssuance"
}

5. Play Store Link Click (Android)

Fired when user clicks the "Get it on Google Play" badge.

Property Value
name Get it on Google Play
component Link
action Click

Example payload:

{
  "name": "Get it on Google Play",
  "component": "Link",
  "action": "Click",
  "feature": "InstantIssuance"
}

Event Flow Diagram

┌─────────────────────────────────────────────────────────────────┐
│                    User visits Dashboard                         │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│              Eligibility API called (if accountId set)           │
└─────────────────────────────────────────────────────────────────┘
                              │
              ┌───────────────┴───────────────┐
              ▼                               ▼
     ┌────────────────┐              ┌────────────────┐
     │  API Success   │              │   API Error    │
     │   (Track #1)   │              │   (Track #2)   │
     └────────────────┘              └────────────────┘
              │                               │
              ▼                               ▼
     ┌────────────────┐              ┌────────────────┐
     │ eligible=true? │              │  Kard hidden   │
     └────────────────┘              └────────────────┘
              │
       ┌──────┴──────┐
       ▼             ▼
   ┌───────┐    ┌───────┐
   │  Yes  │    │  No   │
   └───────┘    └───────┘
       │             │
       ▼             ▼
┌─────────────┐  ┌────────────────┐
│ Kard View   │  │  Kard hidden   │
│ (Track #3)  │  └────────────────┘
└─────────────┘
       │
       ▼
┌─────────────────────────────────────────────────────────────────┐
│                    User clicks store badge                       │
└─────────────────────────────────────────────────────────────────┘
       │
       ├──────────────────┬──────────────────┐
       ▼                  ▼                  ▼
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│    iOS      │    │   Android   │    │   Desktop   │
│ (Track #4)  │    │ (Track #5)  │    │ (Both #4+5) │
└─────────────┘    └─────────────┘    └─────────────┘

Implementation Notes

  1. De-duplication: All events use useRef guards to ensure they fire only once per component mount, preventing duplicate tracking on re-renders.

  2. Skip detection: The called property from Apollo's useQuery is used to prevent false-positive API success events when the query is skipped (e.g., when accountId is not yet available).

  3. Platform detection: Store badge clicks are tracked with platform-appropriate names based on navigator.userAgent detection.


Related Files

  • Component: src/@instant-issuance/components/InstantIssuanceKard/InstantIssuanceKard.tsx
  • Hook: src/@core/hooks/useInstantIssuanceEligibility.ts
  • GraphQL Query: src/@core/graphql/queries/getInstantIssuanceEligibilityQuery.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment