The LUX Quick Start Guide is the place to start to get LUX up and running. Most of the time following the instructions in that guide works great and you'll start seeing LUX data in a few minutes. But sometimes it can get more complicated. Maybe you're loading the LUX snippet with a tag manager and you're not sure if the inline script and lux.js are being loaded in the right order. Maybe you're using a browser that might not support the standard performance APIs. Maybe your code to track User Timing marks and measures just got deployed and you're not sure if it's working.
For these and other situations, LUX has a few APIs that help you figure out what's working and what's not working.
The first step is to load your site in a browser, open the developer console, and call LUX.getDebug(). Here's what that looks like in Chrome 73:
The debug messages above confirm that lux.js was loaded, the session's data was sampled, a User Timing mark was recorded, and the LUX data beacon was sent.
Here are the debug messages for the same page from Safari 12:
The main differences are the messages that indicate Long Tasks and Paint Timing are not supported, which explains why you won't see values for Start Render, First Contentful Paint, First CPU Idle, and JS CPU Time in LUX for Safari.
A big hurdle when debugging LUX is sampling. If you've set a sample rate, you might not fall into the bucket that gets sampled. If that's the case, you'd see a debug message saying:
Sample rate = 50%. This session is NOT being sampled. The data will NOT show up in your LUX dashboards. Call LUX.forceSample() and try again.
In addition to informing you that the session is NOT being sampled, this message suggests calling LUX.forceSample(). The LUX.forceSample() function alters the session cookie such that all subsequent pages are sampled. Note that the session cookie expires after 24 hours or 30 minutes of inactivity, so you might need to call it again.
When troubleshooting LUX, the most basic actions to confirm are that lux.js is loaded, the session is sampled, and the main LUX beacon is sent. It's likely that other questions you have about your LUX deployment are also answered by reviewing the debug messages. If you still have questions after trying these techniques, contact email@example.com.