> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashduty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting Guide

> Comprehensive guide to troubleshooting Flashduty RUM issues, ensuring accuracy and completeness of monitoring data

## Overview

This guide helps you resolve common issues you may encounter when using Flashduty RUM, including data collection anomalies, SDK configuration issues, and performance optimization.

## Data Collection Verification

If you don't see data on the RUM platform, follow these steps to check.

### SDK Installation Check

<Steps>
  <Step title="Check Script Import">
    Confirm that the RUM SDK is correctly imported:

    <CodeGroup>
      ```html CDN Integration theme={null}
      <script
        src="https://static.flashcat.cloud/browser-sdk/v0/flashcat-rum.js"
        type="text/javascript"
      ></script>
      <script>
        window.FC_RUM &&
          window.FC_RUM.init({
            applicationId: "Your Application ID",
            clientToken: "Your Client Token",
            service: "<SERVICE_NAME>",
            env: "<ENV_NAME>",
            version: "1.0.0",
            sessionSampleRate: 10
          });
      </script>
      ```

      ```javascript npm Integration theme={null}
      import { flashcatRum } from "@flashcatcloud/browser-rum";

      flashcatRum.init({
        applicationId: "Your Application ID",
        clientToken: "Your Client Token",
        service: "<SERVICE_NAME>",
        env: "<ENV_NAME>",
        version: "1.0.0"
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Check Console">
    Open browser developer tools (F12) and check if there are JavaScript errors in the Console panel.
  </Step>

  <Step title="Verify Configuration">
    Confirm that the application ID and client token match the configuration in the RUM console.
  </Step>
</Steps>

### Network Request Check

1. Open the browser developer tools **Network** panel
2. Filter requests for `browser.flashcat.cloud`
3. Confirm the request status code is `200`
4. If the request fails, check the specific error message

<Warning>
  If you see CORS errors, check if your CSP configuration is correct.
</Warning>

### Browser Compatibility

Confirm that your browser version is supported:

| Browser           | Minimum Version            |
| ----------------- | -------------------------- |
| Chrome            | 60+                        |
| Firefox           | 60+                        |
| Safari            | 12+                        |
| Edge              | 15+                        |
| Internet Explorer | 11 (limited functionality) |

### Ad Blocker Impact

<Note>
  Some ad blocking extensions may block the RUM SDK from running. We recommend adding your domain and `browser.flashcat.cloud` to the whitelist.
</Note>

## Common Problem Solutions

<AccordionGroup>
  <Accordion title="Data Not Showing">
    **Problem**: SDK configuration is complete, but no data on the platform.

    **Solutions**:

    1. **Wait for Data Sync**: Data typically appears within 2-5 minutes

    2. **Check Initialization Timing**: Ensure SDK is initialized when the page loads

    3. **Check Sampling Rate**: Confirm sampling rate is set appropriately

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      sessionSampleRate: 100  // Set to 100 to collect all sessions
    });
    ```

    4. **Check User Consent**: Confirm user tracking consent status

    ```javascript theme={null}
    flashcatRum.setTrackingConsent("granted");
    ```
  </Accordion>

  <Accordion title="Missing Behavior Data">
    **Problem**: User behavior data is incomplete.

    **Solutions**:

    1. **Enable Behavior Tracking**:

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      trackUserInteractions: true
    });
    ```

    2. **Add Labels to Custom Elements**:

    ```html theme={null}
    <button data-action-name="Submit Form">Submit</button>
    ```

    3. **Manually Record Complex Interactions**:

    ```javascript theme={null}
    flashcatRum.addAction("click", "Custom Button Click");
    ```
  </Accordion>

  <Accordion title="Missing Exception Data">
    **Problem**: JavaScript exceptions are not being recorded.

    **Solutions**:

    1. **Enable Exception Tracking**:

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      trackErrors: true
    });
    ```

    2. **Manually Report Exceptions in try-catch**:

    ```javascript theme={null}
    try {
      // Code that might error
    } catch (error) {
      console.error(error);
      flashcatRum.addError(error);
    }
    ```

    3. **Configure Source Map**: For locating issues in production, see [Source Mapping](/en/rum/error-tracking/source-mapping)
  </Accordion>

  <Accordion title="Performance Impact Concerns">
    **Problem**: Concerned about RUM SDK affecting website performance.

    **Solutions**:

    1. **Only Enable Necessary Features**:

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      trackResources: true,
      trackLongTasks: false,  // Disable unnecessary features
      trackErrors: true,
      trackUserInteractions: true
    });
    ```

    2. **Adjust Sampling Rate**:

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      sessionSampleRate: 50  // Only collect 50% of sessions
    });
    ```

    3. **Filter Non-Critical Resources**:

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      beforeSend: (event) => {
        // Filter out non-critical resources
        if (event.type === 'resource' && event.resource.url.includes('/static/')) {
          return false;
        }
        return true;
      }
    });
    ```
  </Accordion>

  <Accordion title="CSP Configuration Issues">
    **Problem**: CSP policy blocking RUM SDK from running.

    **Solution**:

    Add the following rules to your CSP configuration:

    ```
    script-src 'self' https://static.flashcat.cloud;
    connect-src 'self' https://browser.flashcat.cloud;
    ```
  </Accordion>

  <Accordion title="SPA Page Views Not Recorded">
    **Problem**: Route changes in SPA applications are not being recorded.

    **Solutions**:

    <Tabs>
      <Tab title="React Router">
        ```javascript theme={null}
        import { useEffect } from "react";
        import { useLocation } from "react-router-dom";

        function RumRouteTracker() {
          const location = useLocation();

          useEffect(() => {
            flashcatRum.startView({
              name: location.pathname,
              url: location.pathname + location.search
            });
          }, [location]);

          return null;
        }

        // Use in App component
        function App() {
          return (
            <Router>
              <RumRouteTracker />
              {/* Other routes */}
            </Router>
          );
        }
        ```
      </Tab>

      <Tab title="Vue Router">
        ```javascript theme={null}
        router.afterEach((to) => {
          flashcatRum.startView({
            name: to.name || to.path,
            url: to.fullPath
          });
        });
        ```
      </Tab>

      <Tab title="Manual Recording">
        ```javascript theme={null}
        // Call when route changes
        flashcatRum.startView({
          name: "Product Details Page",
          url: "/products/123"
        });
        ```
      </Tab>
    </Tabs>
  </Accordion>
</AccordionGroup>

## Advanced Debugging

### Enable Debug Mode

Enable debug mode to get detailed logs in the console:

```javascript theme={null}
flashcatRum.init({
  // ... other configuration
  debug: true
});
```

### Force Full Data Collection

Force full data collection during testing:

```javascript theme={null}
flashcatRum.init({
  // ... other configuration
  sessionSampleRate: 100,
  sessionReplaySampleRate: 100
});
```

<Warning>
  Do not use 100% sampling rate in production to avoid generating excessive data and costs.
</Warning>

### Console Debug Commands

The following commands can be used in the browser console:

```javascript theme={null}
// Get RUM internal context
window.FC_RUM.getInternalContext();

// Get current session ID
window.FC_RUM.getSessionId();

// Get current page ID  
window.FC_RUM.getViewId();

// Manually send test event
window.FC_RUM.addAction('test', 'debug_action');
```

### Network Request Analysis

1. Open developer tools **Network** panel
2. Filter `browser.flashcat.cloud` requests
3. View request Payload to confirm data content
4. Check Response to confirm successful reporting

## FAQ

<AccordionGroup>
  <Accordion title="How long until data appears on the platform?">
    Generally within 2-5 minutes, with possible slight delays during peak times.
  </Accordion>

  <Accordion title="Are mobile browsers supported?">
    Yes, mainstream mobile browsers like iOS Safari and Android Chrome are supported, but some advanced features (like Long Tasks monitoring) may be limited.
  </Accordion>

  <Accordion title="How to exclude specific pages from monitoring?">
    You can conditionally decide whether to initialize based on URL:

    ```javascript theme={null}
    // Exclude admin pages
    if (!window.location.pathname.startsWith("/admin")) {
      flashcatRum.init({
        // ... configuration
      });
    }
    ```
  </Accordion>

  <Accordion title="How to track users across multiple subdomains?">
    The following configuration is needed:

    1. Use the same application ID and client token
    2. Set consistent user identification
    3. Enable cross-domain tracking:

    ```javascript theme={null}
    flashcatRum.init({
      // ... other configuration
      allowedTracingUrls: [
        "https://example.com",
        "https://app.example.com",
        "https://shop.example.com"
      ]
    });
    ```
  </Accordion>

  <Accordion title="How to reduce data volume and costs?">
    You can do the following:

    1. **Lower Sampling Rate**: Set `sessionSampleRate` to 10-50
    2. **Disable Unnecessary Features**: Such as `trackLongTasks: false`
    3. **Exclude Specific Pages**: Don't initialize on admin or internal pages
    4. **Configure Data Filtering**: Use `beforeSend` to filter non-critical data
  </Accordion>
</AccordionGroup>

## Contact Technical Support

If you still have issues after following the above troubleshooting steps, please contact our technical support team.

<Steps>
  <Step title="Prepare Diagnostic Information">
    Please collect the following information:

    * Application ID
    * Browser type and version
    * SDK version
    * Console error screenshots
    * Network panel request screenshots
    * Problem reproduction steps
  </Step>

  <Step title="Contact Support">
    * **Email**: [support@flashcat.cloud](mailto:support@flashcat.cloud)
    * **Online Chat**: Click the "Help" button in the bottom right corner of the platform
  </Step>
</Steps>
