---
updatedAt: 2025-06-23T22:28:03.000Z
agentTools:
  projectIndex: https://support.speedcurve.com/llms.txt
---

# Cookie consent banners

SpeedCurve RUM uses a cookie to track page views across a user's session. To prevent this cookie from being set before a user has given their consent, you can load RUM in two stages.

The snippet contains two parts: the **inline snippet**, and the **lux.js script**.

![1400](https://files.readme.io/cb261e6-inline-snippet-luxjs-script.png "inline-snippet-luxjs-script.png")

Normally you would load RUM by putting both the inline snippet and the lux.js script into the `<head>` of your pages. To prevent it from setting a cookie straight away, you should put **just the inline snippet** into the `<head>` of your pages. This will allow it to collect CPU timing data, and will also allow you to use the [RUM JS API](https://support.speedcurve.com/docs/rum-js-api) like normal.

After the user has given their consent for you to use cookies, the lux.js script can be loaded dynamically. An example of how to do this is below (be sure to replace **LUX\_ID** with your real LUX ID):

```javascript
var s = document.createElement("script");
s.src = "https://cdn.speedcurve.com/js/lux.js?id=LUX_ID";
s.async = true;
document.body.appendChild(s);
```

This will cause the lux.js script to be loaded into the page. After this, it will set the session cookie and track performance as normal.