Hey! Has anyone worked out how to target mobile de...
# ask-questions
q
Hey! Has anyone worked out how to target mobile devices only in the js implementation?
f
Should be able to target to the user agent
I think we have code for this in the HTML SDK... let me check the source code
q
Thank you!
Copy code
const ua = navigator.userAgent;
...

deviceType: ua.match(/Mobi/) ? "mobile" : "desktop",