There are several ways to do that, and Heap has some great documentation and more that explains how to set up those API calls whether you're trying to capture things like screen dimensions, so this is more for like designers and product managers who are trying to optimize their website.
Snapshots give a better experience for knowing what what devices and people are coming onto your website and how larger screens are optimized for experience. There are other things you can do like capturing time zones to GEO locate where your customers are coming from who are visiting your website, there are other additional API calls, we can set up such as scroll depth and what image types people are clicking on.
The only thing that I’ll call out about snapshots is that it is not retroactive so it's something you have to think about proactively.
And then there's what we find most important at my company: scroll depth or scroll tracking to see how far people are willing to scroll through for each pages or each type of page, whether it's a category page or a product detail page.
Here are some examples where we borrowed some of this this code from Heap: We set up an event called any page view so anytime someone fires a page view on our website, we can capture the scroll depth of that user on that page; essentially what this code does is it splits the scroll height into 10s so into decimals, and each time someone scrolls past 10% it'll fire this event, here or there.
Another thing that we have used snapshots for is to capture emails when someone's about to check out. So many times, you have a lot of drop off between each step of the funnel when it comes to checking out so just so sometimes a customer would enter the email and then leave their session or never come back, so for us having the snapshot setup to capture that email allows us to re-target those customers.
One more example is using snapshot to track the keywords in product search, based off the keywords that the customer searches. We can then analyze that event to see how trends are changing. For example if we were to see a huge spike in searches for “Pearl,” we’d be able to prepare our stock accordingly.