Add ViewportWidth/Height variables for AMP Analytics
With more devices supporting split-screen (Android N provides it), the screen dimensions aren't as useful. Having the actual browser viewport dimensions available in analytics would better for viewability and verification purposes.
/to @avimehta
Do availableScreenHeight and availableScreenWidth cover this request (https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/analytics-vars.md#device-and-browser)?
Aren't those just the size of the screen minus the toolbars?
If the browser is running split-screen on a mobile device, the screen dimensions shouldn't be changing but the viewport size of the browser would be smaller.
Yes, viewport metrics should definitely be used for something like this. My quick search points to VIEWPORT_HEIGHT and VIEWPORT_WIDTH vars in https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#viewport_height
This is what you want, right?
Ah, yes, somehow I missed those. Do the variables @dvoytenko mentioned work?
Yes, it looks like those should work. Are they currently available for analytics?
Thanks!
@j-e-shaw Yes. As ${viewportHeight} and ${viewportWidth} vars.
I'll close this at this time. But please re-open if needed.