LUX is SpeedCurve's RUM product. Your LUX plan comes with a budget, typically 10 million page views per month. You can buy smaller and larger plans to fit your needs, and we can even pro-rate additional bundles of page views if you decide you need more budget part way through your annual plan.
Unlike some other RUM services, LUX allows you to control how many page views are sampled. This allows you to monitor your pages while staying within a reasonable budget. Sampling is done based on sessions, so your data includes full user journeys through your site.
There are two ways to set your sample rate: in your Settings and with the LUX API.
Using the sample rate in Settings
In your Settings you can click on "Edit LUX" to change your sample rate. You can enter any integer (no decimals) from 0 to 100 inclusive.
This approach to setting the sample rate is easy for making changes since no code changes are necessary. However, the changes do not take effect immediately. When decreasing the sample rate, it can take as long as 15 minutes for the changes to propagate across the LUX servers. When increasing the sample rate, the change depends on whether the real user has lux.js in their browser cache. It can take up to a week for all copies of lux.js to be purged from real user's caches, but typically it takes 1-2 days.
Using the LUX API
The other way to set your sample rate is using
LUX.samplerate = 40;
Make sure this is set before the main lux.js script is loaded.
Setting the sample rate in your code gives you a lot of flexibility because you can vary the sample rate on every page. Here are some scenarios where this is useful:
- If you have multiple properties or products (e.g., marketing pages, customer pages, and support docs) you can vary
LUX.sampleratedepending on the type of page. You might want to have a higher sample rate for customer pages where the content varies depending on the specific user, and have a lower sample rate on the marketing and support pages where the content is more static.
- If your product is used across multiple countries, you might want to have a higher sample rate for countries that have less traffic so that you have enough data to get statistically sound results.
- If you're running an A/B test on a small subset (e.g., 0.1%) of users, you might want to collect 100% of that traffic in order to compare the different test cases.
Note that if you have a sample rate of less than 100% in your Settings, this will always take precedence over the
LUX.samplerate value. For this reason, if you choose to set your sample rate using
LUX.samplerate then you need to ensure the sample rate in your Settings is set to 100%.
How LUX sampling works
LUX sampling works at two layers: on the client and during beacon collection. This flow chart explains the points at which a beacon may be rejected.