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

# All Pixel Functions

> Every function the Northbeam Pixel provides, and where each one is documented.

The Northbeam Pixel adds these functions to `window.Northbeam`. The [Northbeam Pixel](/docs/add-pixel) must be on the page before you call any of them. Each one works the same way on Shopify and custom stores.

<span id="firecustomgoal" style={{ display: "block", scrollMarginTop: "7rem" }} />

<span id="identify" style={{ display: "block", scrollMarginTop: "7rem" }} />

<span id="identifycustomerid" style={{ display: "block", scrollMarginTop: "7rem" }} />

<span id="trackpageview" style={{ display: "block", scrollMarginTop: "7rem" }} />

<span id="react-router-example" style={{ display: "block", scrollMarginTop: "7rem" }} />

| Function | What it does | Documented in |
| :- | :- | :- |
| `fireSlimPurchaseEvent` | Records a completed order. **Recommended.** | [Purchase Events](/docs/purchase-pixel#window-northbeam-fireslimpurchaseevent) |
| `firePurchaseEvent` | The original purchase function. Only its order ID is used | [Purchase Events](/docs/purchase-pixel#window-northbeam-firepurchaseevent) |
| `identify` | Links the visitor to their email address | [Identify Events](/docs/third-party-checkouts#identify-reference) |
| `identifyCustomerId` | Links the visitor to their customer ID | [Identify Events](/docs/third-party-checkouts#identifycustomerid) |
| `trackPageView` | Records a page change on single-page apps only | [Page View Events](/docs/page-view-events) |
| `fireCustomGoal` | Records a custom action, like a sign-up or add-to-cart | [Custom Goals](/docs/setting-up-custom-goals) |
| `fireEmailCaptureEvent` | Records an email sign-up | [Below](#fireemailcaptureevent) |
| `onNorthbeamLoad` | Runs your code as soon as the pixel loads | [Below](#run-code-when-the-pixel-loads-onnorthbeamload) |

***

## `fireEmailCaptureEvent`

Records that a visitor signed up with their email address, for example through a newsletter form.

```javascript theme={null}
window.Northbeam.fireEmailCaptureEvent("john.smith@gmail.com", "klaviyo_footer")
```

| Argument | | Type | Description |
| :- | :- | :- | :- |
| 1 | *required* | String | The email address |
| 2 | | String | Where the email was captured (for example, `"klaviyo_footer"`) |

<Note>
  You don't need to call `identify` after `fireEmailCaptureEvent`. It identifies the visitor automatically.
</Note>

<span id="add-a-onload-callback-function-for-the-northbeam-pixel-onnorthbeamload" style={{ display: "block", scrollMarginTop: "7rem" }} />

## Run code when the pixel loads (`onNorthbeamLoad`)

Use this to call a Northbeam function as soon as the pixel is ready. This helps if your code might run before the pixel has loaded.

```javascript theme={null}
<script type="text/javascript">
  const func = () => {
    // get args
    window.Northbeam.fireSlimPurchaseEvent(orderId)
  }

  if (window.Northbeam) {
    // Northbeam is already loaded, so call the function now
    func()
  } else {
    // Northbeam isn't loaded yet. Save the function in
    // window.onNorthbeamLoad, and the pixel will call it
    // as soon as window.Northbeam is ready.
    window.onNorthbeamLoad = func
  }
</script>
```
