While this may hide the badge on mobile, it does not prevent the platform from loading it in the background (and possibly costing a “view”). Would be nice if the platform skipped loading it if the element was display: none;
If you want to display your widget only on desktop and do not count views on mobile, replace the 1st line of the widget’s installation code with this script: