Hi everyone! We’ve seen a fair bit of confusion about how best to redirect mobile visitors to a mobile-optimized landing page recently, in particular when you have URL parameters to think about, or you’d like to redirect desktop visitors to a separate page too. Here are a couple of scripts that should simplify this.
Mobile redirect (just to mobile)
Use this version of the script if you want to redirect just mobile visitors, and leave desktop visitors on the current page.
Mobile redirect (to mobile and desktop)
Or use this version if you’d like to redirect desktop visitors to another page as well.
desktopURL to match your page URLs.
The scripts use much more robust mobile detection than before, and will pass on all URL parameters and #anchors.
This is definitely a workaround so please bear in mind that you may experience issues with visitor/view/conversion tracking, depending on which version of the script you use. If this is something you’re concerned about, please contact us at email@example.com, and we’ll try our best to point you in the right direction.
Let us know what you think!