RUM JavaScript API - 1.345.1
    Preparing search index...

    Function isEnabled

    • Indicates whether RUM JavaScript is currently enabled, taking into account the opt-in mode settings and the current opt-in (consent) state.

      Returns boolean

      true if RUM JavaScript is enabled, otherwise false.

      // Skip expensive computation when the agent is not collecting data
      if (dynatrace.isEnabled()) {
      const payload = buildExpensiveAnalyticsPayload();
      dynatrace.sendEvent(payload);
      }