Solved

Is it possible to group by screen resolution in Heap?


Userlevel 1
Badge

I want to see the screen resolutions more used by our customers.

icon

Best answer by jonathan 15 March 2022, 17:49

View original

11 replies

Userlevel 5
Badge +3

Hey @Lori! Good question. We don’t provide this out-of-the-box but you can capture it using our Snapshots feature, which lets you attach additional data to events. 

Snapshots get fired when a Heap event is fired. You can think of it as a kind of tag manager where the event is the trigger. Here’s the steps to capture Screen Resolution.

  1. You want this data to be captured on every page, so you need to have an event that fires on every page. You can do this with the `*` wildcard character. 
  2. You can access the screen width and height via the `screen` object. You can join width and height together to return a Screen Resolution property. 
window.screen.width + ' x ' + window.screen.height

Here’s the finished product.

 

You can find other interesting Snapshots examples in our developer docs.

Hope this helps!

Userlevel 2

Hi, thanks for sharing this! Is anyone also experiencing getting results, where the majority reads as “no data”? I’ve set up the snapshot following the example above, and it looks like it works just fine, but I’m for sure missing something.

 

Could you provide an example of how to use the Screen Resolution Property correctly as part of a chart to include on a Dashboard? I’m struggling to understand how to correctly leverage. 

 

Userlevel 4
Badge +3

@werku It’s important to note that snapshot properties only begin capturing data from the moment they are created (they aren’t retroactive like some of Heap’s other autocaptured data). If you had just set it up, it may just be that the date range you used includes a large portion of traffic that occurred before the snapshot was setup. 

Could that be what’s happening here?

Userlevel 4
Badge +3

@ikonik Once you have setup the snapshot to capture your users’ screen resolution, you can use it just like any other property in Heap. 

A common analysis would be something like the below in the Usage Over Time module (you would get an output that looks very similar to the one @werku shared above. Essentially you want a count of pageview grouped by your newly created screen resolution property,
 

 

Userlevel 2
Badge +1

Hi! I set up the Snap Shot about 10:05 am this morning. At 11am, still seeing quite a bit of No Data for both Mobile and Desktop. Any guess why and potential fix if any? Thanks!

 

Userlevel 5
Badge +3

@jinahlee1234 Likely some caching, or maybe users with long running sessions that hadn’t pulled a new heapjs. How do things look now?

Userlevel 2
Badge +1

@jonathan Would ‘reject to cookies’ and ‘ask app not to track’ affect as well? In any event, significantly less No Data on Day 2. Thank you!

Userlevel 5
Badge +3

@jinahlee1234 It shouldn’t, as in those cases you probably really shouldn’t be loading Heap, so you shouldn’t just get (no data), you should get, well, no data. 

This is a snapshot that doesn’t rely on timing so I’m not 100% sure why some data would be missing. First I’d check the % of pageviews that are missing the property (get a sense of scale, maybe it doesn’t matter), and then I’d look at pageviews with a filter for `Screen Resolution is not defined` and group by domain and path in case there are any commonalities or edge cases you’re missing. 

Are there cases where “to value to javascript” is not available?
If yes, what are the alternates for the same

Userlevel 5
Badge +3

@dvb Your admin may have disabled JavaScript snapshots or you may not have sufficient permissions to add Snapshots. 

The alternative for this use case would be asking your engineers to implement the addEventProperties API.

Reply