# Edge Pulse JavaScript tag

The Edge Pulse JavaScript tag is the script that collects measurements from the browsers of the visitors to your pages. [Edge Pulse](/en/documentation/platform/edge-pulse/) serves it from Azion Console in two forms, the **Default Tag** and the **Pre-loading Tag**.

The tag Azion Console serves is customized for your account, so this page describes the two forms rather than reproducing either one. Copy the tag your own Console serves, and do not reuse a tag taken from anywhere else.

The tag is fully asynchronous. It respects the protocol in use, HTTP or HTTPS. It does not interfere with the loading process or with the internal structure of the delivered content.

---

## Tags

Both Edge Pulse tags go in the same place, in the HTML of the page and before the closing `body` tag. They differ in when the browser runs them.

| Tag                 | When it runs                                                                                             | When to choose it                                                                                                                               |
| ------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **Default Tag**     | After the loading event completes. The tag waits for that event, then downloads and runs the RUM Client. | The page allows inline JavaScript. Waiting for the loading event keeps that event uninterrupted and leaves the visitor's experience unaffected. |
| **Pre-loading Tag** | Before the load event fires.                                                                             | The page carries Content Security Policy settings that prevent the use of inline JavaScript.                                                    |

## Tag placement

Edge Pulse measures a page only when that page carries the tag. The tag is on the **Edge Pulse** page in [Azion Console](https://console.azion.com), behind the **Copy to Clipboard** button. One tag covers one page, and Edge Pulse collects nothing for a page that carries no tag.

The tag is published by hand, or through a tag management system. When the browser runs it depends on which of the two tags you added. To copy the tag and add it to a page, refer to [Edge Pulse quickstart](/en/documentation/platform/edge-pulse/quickstart/).

---

## What the tag does not take

The tag has no settings. There is no sampling rate to lower, no field to exclude from what it sends, and no way to keep your own traffic out of the measurements. Choosing between the **Default Tag** and the **Pre-loading Tag**, and choosing which pages carry a tag at all, are the two decisions available to you.

The tag also measures only the page load it runs on. It does not watch for later route changes, so a single-page application reports one measurement per full load. For why that follows from when the tag runs, refer to [How Edge Pulse works](/en/documentation/platform/edge-pulse/how-it-works/).

---

## Browser settings

Edge Pulse reads the `navigator.doNotTrack` setting of the visitor's browser. The value decides whether the visitor identifier survives from one visit to the next.

| Value                                         | Behavior of Edge Pulse                                                                                                                                                                                                                                                                |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `navigator.doNotTrack` set to `1`             | If tracking was never allowed, and Edge Pulse therefore never used the local storage, an identifier is generated for each visit the visitor makes to the site. If the value is `1` but the visitor was tracked before, the previous identifier is deleted and a new one is generated. |
| `navigator.doNotTrack` set to any other value | Edge Pulse tracks, and the same identifier is used for each visit of a visitor.                                                                                                                                                                                                       |

## Visitor identifier

Edge Pulse identifies a visitor with a value generated by the UUID4 algorithm, the random variant of the universally unique identifier scheme. It keeps that value in the local storage of the browser, the store a browser holds for one site and does not clear when the page closes. The `navigator.doNotTrack` setting decides how long the value lives.

To follow the identifier through a measurement, refer to [How Edge Pulse works](/en/documentation/platform/edge-pulse/how-it-works/).

## Collected data

Edge Pulse collects information such as the resolver used for DNS resolution, the data center tested, and the visitor's anonymous network. Those are instances of the five categories the collected data falls into:

- Navigation
- Performance
- User experience
- Informational
- Network

---

## Related resources

- [Edge Pulse quickstart](/en/documentation/platform/edge-pulse/quickstart.md): The steps for copying the tag from Azion Console and adding it to the pages you want to monitor.
- [How Edge Pulse works](/en/documentation/platform/edge-pulse/how-it-works.md): How the tag performs a test and what happens to the measurement afterward.
- [Edge Pulse](/en/documentation/platform/edge-pulse.md): What Edge Pulse is, and what it measures from the browsers of real visitors.
- [Glossary](/en/documentation/platform/edge-pulse/glossary.md): The terms these pages use for the two tags, the test, and the visitor identifier.
