New mobile redirection script


#1

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.

For either script, you just need to click the Javascripts button in the bottom left of the page builder, select ‘Head’ for placement, paste the script in and republish the page. Make sure you change the values of mobileURL and/or 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.

We owe a big thanks to Markus Stefanko, who adapted our older script to use detectmobilebrowsers.com detection and pass along #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 support@unbounce.com, and we’ll try our best to point you in the right direction.

Let us know what you think!


How to get a responsive landing page?
How to get a responsive landing page?
#2

This is a much better redirect option than the previous suggestions using meta refresh scripts and regular redirect javascript. The experience is far improved since the original page doesn’t load before redirecting.

However, the view statistics of the original page are still impacted. Is there any way around that?

Thanks,

Amanda


#3

Hi Amanda - If you use the mobile only redirect, that will affect your desktop stats. The “to mobile and desktop” redirect code will let you keep your mobile and desktop stats separate though.

If you create a third page with just the mobile and desktop redirect code on it, you can direct people to that URL. They’ll then be pushed to either the desktop page or the mobile page. You’ll get the double counts on the page with the redirect, but the stats for your individual mobile and desktop stats will be kept separate,


#4

Hi Amanda. Please see Quinn’s reply below! I’d also like to add that either version of this script (and the older one too) will perform the redirect without waiting to load the page, as long as you ensure the script placement is ‘Head’. Thanks!


#5

Hi Quinn and Mark,

Thanks for your replies. My comment was regarding the retention of original page stats after redirect, which doesn’t seem possible.

To illustrate, we had a webinar registration page in Unbounce. After the webinar took place, we posted the recording and slide deck to a resources page on our website. I’ve redirected the registration page to the new resources page, but the views on the registration page continue to climb, impacting our conversion statistics for that design.

It’s not “the end of the world”, but it would be great to have an option where the original page (in this case, the registration page) stats retained for future analysis on the most effective designs.

Thanks again,

Amanda


#6

Hey Amanda - In cases like this the best approach is to unpublish and set the webinar registration page to a different URL. Then create and set a new page with only the redirection script to the original registration URL. This should prevent any further impact to your original registration page stats.


#7

Thanks - working well so far.

For others: I copied my main page to create a desktop variant, and then create a mobile page from scratch. With those setup, clean, tested, and published, I turned my main landing page into a redirect-only stub and recording my stats previous to the split. Overall didn’t take very long and it appears to behave as intended.

Looking forward to more integrated support mobile support in the future.


#8

Is there a way to do this without losing UTM parameters at the end of the URL?


#9

Hey there! The script will automatically carry over the UTM parameters to the redirected link


Mobile view linking to 'old'/current mobile page
#10

Hi Quinn, I’m using the “to mobile and desktop” approach on a few pages and I am a little confused about why the total visitor count is not adding up. To clarify, I have set up 3 pages:

I’ve got the redirect script on landingpage.com and it is showing 8 unique visitors. landingpage.com/mobile is showing 1 unique visitor and landingpage.com/desktop is showing 2 unique visitors for a total of 3 uniques.

What happened to the other 5 that hit landingpage.com?


#11

Hi Frank - I took a look at your pages and looked at the traffic coming to the redirect page. Four of the hits were bots, so they would have either disabled the redirect or abandoned the page after it fired and it looks like the other unaccounted for hit was from the Twitter for iPhone browser. The last one is likely someone who clicked out from Twitter and then immediately backed out to their timeline again.


#12

Got it thanks Quinn.


#13

Happy to help, Frank. You’ll likely see some discrepancy going forward for the same reason, but if you do ever want us to take a look, just reply here or shoot us an email at supportATunbounce.com and I can take a look again to make sure everything’s accounted for.


#14

Wouldn’t it be a better approach to design for mobile first with progressive enhancement, or to just design responsively?

I think the requirement to design two different pages is creating extra work where it’s not required.

Tim


#15

Hi Tim - Completely agreed. This is just a workaround and not meant to be an ideal solution. We’re in the process of building responsive page design and are running a closed alpha test with a handful of customers right now. We want to create a much more elegant solution for you that isn’t any extra work.


#16

I’m really struggling with the concept of these solutions. Let’s assume I create 3 pages: a routing page, a mobile page and a desktop page. Won’t our quality score be negatively affected by the “routing landing page”?

I don’t see a clear solution without significant downsides and this is posing a major issue for us.


#17

Hey Christopher - A redirect should not have a affect on your Quality score. See this Adwords forum post below:

https://www.en.adwords-community.com/t5/Advanced-Features/Page-Redirection-Will-effect-to-quality-sc…

The summary is Google follows the redirect to the actual pages.


#18

Hey everyone, any chance Unbounce can provide me with a third code, one that redirects ipad users to an ipad sized page?


#19

Hi Mitch! Great question.

Right now, the scripts above don’t treat tablets as mobile devices Ð so they won’t be sent to the mobile version.

We’ve found that this is what most people want.

Our templates are between 900 and 1000px wide, so this makes them pretty ideal for tablets. For example, an iPad in landscape mode is 1024 effective pixels wide, so it fits perfectly. In portrait mode it’s 768px Ð so this means your page will appear ‘zoomed out’ slightly, but likely not enough to make any text unreadable.

Mitch, can I ask for some more details about your thinking behind redirecting tablet users to a third version of your page? We don’t have a script for it at the moment, so we’d like to look into this some more.


#20

Doesn’t seem to work on windows phones