Browser window resolution size

Hi

Is there a way to track viewport resolution out-of-the-box i Piwik, or do I need to add some javascript to add these details?

To be precise I’m not referring to the screen resolution, but rather the size of the users browser window.

Br.
Martin

Hi there!

Unfortunately, there is no out-of-the-box browser size tracking in Piwik PRO, only screen size.
You can access those properties directly from the window object in JavaScript. There are methods to get both the inner and outer sizes of the window (for example: window.outerWidth)

Thank you.

As a follow-up question, do you know of any best-way practices of doing this? I’m thinking of adding it to a custom dimension and tie it to the session dimension at the start of the session. But what if the browser changes size during the session? Should I disregard this and just settle for the initial browser size? Or is there a smarter way to do this?

Br.
Martin

Went ahead and tied it to the event scope in the custom dimension:

1 Like

It really depends on what are your needs and what will you use this information for. Generally, keeping it in a custom dimension would be useful. If you decide to use session scope and the browser size changes during the session - the value will also change accordingly. If you don’t want this to happen you could also use the event scope. Here’s an article comparing those two scopes in detail: Create a custom dimension | Piwik PRO help center.

I think our last messages just crossed paths, but just want to say thanks for your help. It seems the event scope would indeed be the best option.

1 Like