Device Detection Code

When inserted into your desktop website, the device detection code acts to redirect people using mobile phones to your mobile-optimised website.

Option 1 - Automatic Forwarding

To automatically forward mobile internet web-visitors to the mobile version of your website insert the JavaScript device detection code found below just before the </head> tag in the template of your main website. Often this template file would be called Header.

You can normally find the </head> tag near the top of your website's html code.

Replace [ADDRESS OF YOUR MOBILE STORE] with your MymCart mobile store URL (which can be found in your store's Dashboard. You can also find this JavaScript device detection code in the confirmation email you received when you registered.

For your mobile-optimised website to become functional, it is essential that this device detection code be added to your desktop website.

If you have any questions, please do contact us and we will be happy to help.

Optimized website
Mobile-optimised websites,
however, make it easier
to read and navigate.
Unoptimized website
Standard websites are
tricky to use on small devices.

Option 2 - Confirm Before Forwarding

Alternatively, if you wish to offer visitors the option of staying on your non-mobile optimised website please use the code below. This will prompt mobile-users with a message asking them if they would like to view your mobile-optimised website.

Please replace [ADDRESS OF YOUR MOBILE STORE] with the address of your mobile site and [YOUR CONFIRMATION MESSAGE] with the message you want displayed to your visitors. Again your MymCart mobile store URL can be found on the Dashboard.

Confirmation message

Linking Directly To Products - Commerce customers

Commerce customers have the option to redirect customers from desktop product pages to their mobile equivalent with the use of an alternative device detection code.

Please replace [STORENAME] and [YOUR PRODUCT ID] as appropriate. You can find [STORENAME] in your dashboard whilst [Your PRODUCT ID] should match the relevant information in the product CSV file you would have already uploaded into the Products section of the MymCart dashboard.