How do I utilize the HTML5 Embed Code option?

The Embed Code under your HTML5 app tab redirects users who visit your mobile site on their device to your new HTML5 app version. This allows your app to become your site's complete mobile experience.

If you don't wish to point users to your app automatically when they visit your site on their mobile device, this option may not be for you.

After you've completed the HTML5 domain process, this code will propagate with your personal domain information.

Where to place this code

This code (script) should be placed in the header in of your site's HTML. For example:

<html>
<head>

<script type="text/javascript">
function seIsMobile() { 
    var userAgent = navigator.userAgent.toLowerCase();
    var devices = ['android', 'iphone', 'ipod', 'ipad'];
        for(var i in devices) { 
            var device = devices[i];
            if (userAgent.indexOf(device) != -1) {
                return true;
            }
        }
    return false;
};
if (seIsMobile()) { location.href = 'http://app.yoursite.com'; }
</script>

</head>
<body>
</body>

</html>

---

If you don't have access to your HTML header area, try placing this code anywhere in your homepage framework that accepts script.

Some CMS or site providers don't allow external script in their platform, and you may want to check with your site manager or CMS provider if you're unsure how to insert this type of code.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us