> ## 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

> Solve common issues with Flashduty RUM Web SDK, including data collection problems, SDK configuration, and performance optimization

<Info>
  This guide helps you resolve common issues encountered when using Flashduty RUM Web SDK, including data collection anomalies, SDK configuration problems, and performance optimization.
</Info>

## 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 Inclusion">
    Confirm that the RUM SDK is correctly included:

    <CodeGroup>
      ```html CDN Import 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_APP_ID",
            clientToken: "YOUR_CLIENT_TOKEN",
            service: "<SERVICE_NAME>",
            env: "<ENV_NAME>",
            version: "1.0.0",
            sessionSampleRate: 10
          });
      </script>
      ```

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

      flashcatRum.init({
        applicationId: "YOUR_APP_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 the Console panel for JavaScript errors.
  </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 **Network** panel in browser developer tools
2. Filter for `browser.flashcat.cloud` requests
3. Confirm the request status code is `200`
4. If requests fail, check the specific error message

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

### Browser Compatibility

Confirm your browser version is supported:

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

### Ad Blocker Impact

<Note>
  Some ad blocker plugins may block RUM SDK operation. We recommend adding your domain and `browser.flashcat.cloud` to the whitelist.
</Note>

## Common Issue Solutions

<AccordionGroup>
  <Accordion title="Data Not Showing">
    **Problem**: SDK configuration is complete, but no data appears 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 page loads

    3. **Check Sample Rate**: Confirm sample rate is set appropriately

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

    4. **Check User Authorization**: 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 config
      trackUserInteractions: true
    });
    ```

    2. **Add Markers 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 Error Data">
    **Problem**: JavaScript errors are not being recorded.

    **Solutions**:

    1. **Enable Error Tracking**:

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

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

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

    3. **Configure Source Maps**: For easier production debugging, 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 config
      trackResources: true,
      trackLongTasks: false,  // Disable unneeded features
      trackErrors: true,
      trackUserInteractions: true
    });
    ```

    2. **Adjust Sample Rate**:

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

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

    ```javascript theme={null}
    flashcatRum.init({
      // ... other config
      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 blocks RUM SDK operation.

    **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 on route change
        flashcatRum.startView({
          name: "Product Details",
          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 config
  debug: true
});
```

### Force Data Collection

Force full data collection during testing:

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

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

### Console Debug Commands

Use the following commands 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 for `browser.flashcat.cloud` requests
3. View request Payload to confirm data content
4. Check Response to confirm successful upload

## FAQ

<AccordionGroup>
  <Accordion title="How long until data appears on the platform?">
    Typically within 2-5 minutes, may be slightly delayed during peak times.
  </Accordion>

  <Accordion title="Are mobile browsers supported?">
    Yes, iOS Safari and Android Chrome and other mainstream mobile browsers 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({
        // ... config
      });
    }
    ```
  </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 config
      allowedTracingUrls: [
        "https://example.com",
        "https://app.example.com",
        "https://shop.example.com"
      ]
    });
    ```
  </Accordion>

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

    1. **Lower Sample Rate**: Set `sessionSampleRate` to 10-50
    2. **Disable Unnecessary Features**: e.g., `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 Support

If issues persist after troubleshooting, 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
    * Steps to reproduce the issue
  </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>

## Related Documentation

<CardGroup cols={3}>
  <Card title="SDK Integration Guide" icon="plug" href="/en/rum/sdk/web/sdk-integration">
    Learn how to quickly integrate the RUM SDK
  </Card>

  <Card title="Advanced Configuration" icon="sliders" href="/en/rum/sdk/web/advanced-config">
    Learn about advanced SDK configuration features
  </Card>

  <Card title="Compatibility" icon="browser" href="/en/rum/sdk/web/compatible">
    Learn about browser and framework compatibility
  </Card>
</CardGroup>
