I need to send the screen resolution from the user's device through DataDog.
As it is easy to get window.screen.width
and window.screen.height
values, I have no clear idea how to send the values. My idea is to send a custom action:
import { datadogRum } from '@datadog/browser-rum';
(function sendScreenSize() {
datadogRum.addAction('screenSize', {
'width': window.screen.width,
'height': window.screen.height
})
})();
Is there any cleaner solution?