How does it work?
To make use of Netbiscuits Device Detection WordPress plugin, all you have to do is install the plugin, configure it, and start using it.
The Netbiscuits Device Detection WordPress plugin configuration page looks like this:
With the WordPress plugin configured, the following events happen when a user’s browser requests a page from your website:
- Your server requests the Device Detection profile from a Netbiscuits Device Detection server
- The Device Detection server runs a series of tests to identify the user’s device
- A collection of parameters and values is created and returned to your server in JSON format
- Device Detection can also (optionally) gather dynamic data within the user’s browser, like current Bandwidth and Geolocation – Learn more about using using Dynamic Parameters
- Once complete, the Device Detection object can be used to customize the user’s experience for the exact device they are using
How can I use the Device Detection WordPress plugin?
- First of all, make sure you’ve created a Netbiscuits account and have logged in.
- If you’re all set there, then you need to install the Netbiscuits Device Detection WordPress plugin.
- Next, copy and paste each of the WordPress plugin configuration blocks into the plugin’s admin page, found here:
- Once the Device Detection WordPress plugin loads, all of the Device Detection parameters will be available in a global object called
- Finally, you are ready to make use of the Device Detection information in your code, something like:
<dl> <dt>Device Type:</dt> <dd><?php echo $dd->devicetype; ?></dd> <dt>Device Model:</dt> <dd><?php echo $dd->model; ?></dd> <dt>Can this device play h264?:</dt> <dd><?php echo ($dd->h264) ? 'yes' : 'no'; ?></dd> <dt>Is this device touch-capable?:</dt> <dd><?php echo ($dd->touch) ? 'yes' : 'no'; ?></dd> <dt>What is the largest image width this device can display?:</dt> <dd><?php echo $dd->imagemaxwidth; ?></dd> </dl>
To help you further with getting started, we have created a series of demos that you can download and run on your own server (including your localhost).
We hope this has helped you get up and running with the Netbiscuits Device Detection WordPress plugin. If you have any questions about any of this, please contact us.
Or if you’re ready for the next step, find out about all the Device Detection Parameters you can build into your website!