Capture Orientation via Snapshots

You can capture screen orientation (on pageload only: APIs for tracking orientation changes are not supported across all popular browsers) via Snapshots. This is helpful for understanding how users are consuming your content. This gives you the data to understand if it’s worth optimizing for different views. Use the snapshot below to capture screen orientation:

Name: Screen orientation

JavaScript Snapshot: (function() { if(window.innerHeight > window.innerWidth){ return "Vertical" } else { return "Horizontal" } })();

Last updated