# Generate a HAR File for Web Debugging and Performance Analysis

**URL:** <https://community.dynatrace.com/t/generate-a-har-file-for-web-debugging-and-performance-analysis/41692>\
**Category:** Troubleshooting\
**Tags:** real-user-monitoring-classic, user-sessions\
**Created:** [September 26, 2023, 1:17pm UTC](https://community.dynatrace.com/t/generate-a-har-file-for-web-debugging-and-performance-analysis/41692 "2023-09-26T13:17:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dyna\_Patrick](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dyna\_Patrick](https://community.dynatrace.com/u/Dyna_Patrick)\
**Post date:** [September 26, 2023, 1:17pm UTC](https://community.dynatrace.com/t/generate-a-har-file-for-web-debugging-and-performance-analysis/41692/1 "2023-09-26T13:17:14Z")

</div>

_Summary:&nbsp;This article explains how to generate a HAR file using browser developer tools. It includes step-by-step instructions for capturing network traffic to diagnose performance problems._

## Abstract

This article provides information on what a HAR file is and how to generate one.&nbsp;It covers **Google Chrome** , **Microsoft Edge** , and **Mozilla Firefox** (to get a HAR file for Mobile Application with a webview,&nbsp;see&nbsp;[this article](https://community.dynatrace.com/topic/200413)).

## What is a HAR File?&nbsp;

A HAR (HTTP Archive) file is a log of all network requests made by a web page in your web browser. It includes details about each request, such as the URL, response headers, request headers, and timings.

A HAR file is a useful troubleshooting tool&nbsp;because it provides a comprehensive snapshot of a web page’s network activity, allowing for precise issue identification.

## How to generate a HAR File&nbsp;

### **Chrome and Edge**

#### **Step 1: Open Developer Tools**

Open Developer Tools using one of the options below:

- Open the Browser and press F12 on your keyboard, or
- Right-click anywhere on the page and select “Inspect” or “Inspect Element”, or
- On Chrome, you can also use the three-dot menu in the top-right corner of the browser \> More tools \> Developer tools.

#### **Step 2: Enable log preservation**

1. In Developer Tools, click on the “Network” tab.
2. Ensure the “Preserve log” checkbox is checked.  
This option keeps the network log intact even after a page refresh or navigation.
3. Ensure the “Disable cache” checkbox is checked.  
This option keeps the network log fresh and not cached.
4. Optionally, you can clear the network log by clicking the “Clear” button. ∅

Chrome and Edge:

 ![image (7).png](https://global.discourse-cdn.com/dynatrace/original/2X/5/58fda4339c95ca6a7c4ccf60c48cc09f3da4105d.png)

#### **Step 3: Allow sensitive data to be captured in the HAR file**

In order for cookies to be included in the HAR file, the ‘Allow to generate HAR with sensitive data’ must be enabled.

1. Open Settings

2. Select the Preferences tab

3. Scroll to the Network section

4. check the ‘Allow to generate HAR with sensitive data’ checkbox

#### **Step 4: Generate traffic**

To capture all network activity on the webpage, you’ll need to reload the page or perform the specific actions that trigger the network requests you’re interested in (e.g., submitting a form, clicking a link, etc.).

**Note:** &nbsp;the actions must be completed in the same tab as Developer Tools is open in for the traffic to be recorded

#### **Step 5: Stop Recording**

1. Once you’ve captured the network activity you need, return to the “Network” tab in Developer Tools. You should see a list of network requests made by the webpage.
2. Click the red “Stop” button (square icon) in the top-left corner of the “Network” tab to stop recording network activity.

#### **Step 6: Export the HAR File**

Export the HAR file using one of the methods below:

1. In Network Requests
  1. Right-click anywhere in the list of network requests.
  2. Select Copy \>&nbsp; “Copy All as HAR (with sensitive data)”.
  3. Choose a location on your computer to save the HAR file, give it a descriptive name, and click “Save.”  
or

2. From Network settings bar
  1. Click “Export HAR (with sensitive data)”
  2. Choose a location on your computer to save the HAR file, give it a descriptive name, and click “Save.”

### Firefox

#### Step 1: Open Network Monitor

Open Network Monitor (Web Developer Tools, Network tab) using one of the options below:

- Open the Browser
  - and press CTRL + SHFT + E on your keyboard, or
  - and select Tools \> Web Developer \> Web Developer Tools. Then, &nbsp;select the&nbsp;“Network”&nbsp;tab

#### Step 2: Persist Logs

1. Ensure the “Persist logs” checkbox is checked.  
This option keeps the network log intact even after a page refresh or navigation.
2. Optionally, you can clear the network log by clicking the bin icon&nbsp; &nbsp;  
 ![HannahM_4-1739890558929.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/0dcb9efd5856a2884905204ebb0ecc2ad813e173.png)

#### Step 3: Generate Traffic

To capture all network activity on the webpage, you’ll need to reload the page or perform the specific actions that trigger the network requests you’re interested in (e.g., submitting a form, clicking a link, etc.).

**Note:** &nbsp;the actions must be completed in the same tab as Web Developer Tools is open in for the traffic to be recorded

#### Step 4:&nbsp; **Stop Recording**

Once you’ve captured the network activity you need, return to the “Network” tab in Web Developer Tools. You should see a list of network requests made by the webpage.

1. Click the “pause” button,&nbsp;| | , to stop recording network activity.

#### **Step 5: Export the HAR File**

Export the HAR file using one of the methods below:

1. In Network Requests
  1. Right-click anywhere in the list of network requests.
  2. Select “Save All As HAR”.
  3. Choose a location on your computer to save the HAR file, give it a descriptive name, and click “Save.”  
or

2. From Network settings bar
  1. Click “HAR”
  2. Select “Save All As HAR”.
  3. Choose a location on your computer to save the HAR file, give it a descriptive name, and click “Save.”

## Useful Links

[How to get HAR files for webviews?](https://community.dynatrace.com/topic/200413)

[How to enable dtHealthCheck](https://community.dynatrace.com/topic/270111)

[Web applications: Use Fiddler for debugging](https://community.dynatrace.com/topic/239009)

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [September 27, 2023, 10:06am UTC](https://community.dynatrace.com/t/generate-a-har-file-for-web-debugging-and-performance-analysis/41692/2 "2023-09-27T10:06:02Z")

</div>

Great write up. Really helpful info. Thanks Patrick.

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [October 16, 2023, 10:32am UTC](https://community.dynatrace.com/t/generate-a-har-file-for-web-debugging-and-performance-analysis/41692/3 "2023-10-16T10:32:42Z")

</div>

Great 🙂 Thank you !

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [November 7, 2026, 10:48am UTC](https://community.dynatrace.com/t/generate-a-har-file-for-web-debugging-and-performance-analysis/41692/4 "2026-11-07T10:48:40Z")

</div>

It seems that tehere is a missing point here which is enabling the user-agent flag
