Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Analytics
English French
English French

Is it possible to measure the number of times a site has been displayed in landscape mode?

There is no native out-of-the-box analysis in Piano Analytics that directly tells you whether a site or app was viewed in landscape mode.

On Websites

Measuring landscape vs. portrait mode on a website is not reliably possible. The screen resolution reported by a smartphone browser will in many cases be that of the screen itself, meaning there is no change to the value between portrait and landscape mode. In some cases, the resolution is based on the browser window size, which does change, but this data is corrupted by resolutions based on screen size, making it unreliable for orientation detection.

Standard properties like device_screen_height and device_screen_width are scoped to pageviews, meaning they capture the first value upon page load and won't automatically reflect orientation changes during a session if no other pages is loaded afterwards.

On Mobile Apps

In a native mobile application, information about switching between portrait and landscape mode can be natively obtained at the app level. However, Piano Analytics does not have a built-in property for this, you need to implement it yourself.

  1. Create a custom property in your Data Model (via Data Management):

    • Choose a name such as device_orientation

    • Select the appropriate type (e.g., String with values like "landscape" or "portrait")

    • Choose Event scope so that the value is captured with every event, accommodating orientation changes during a session

  2. Modify your tagging in the mobile app:

    • On each event sent via the iOS or Android SDK, detect the current device orientation natively and pass it as the custom property value

  3. Analyze the data in Data Query:

    • Use the custom property as a dimension to break down traffic by orientation.

Last updated: