Device Detection in Sitecore

Sitecore 9 has introduced many features that empowers the marketers. Boosting out the Sitecore device detection service by seamlessly integrating with 51Degrees is one of those.

51 Degrees provides the most comprehensive and up-to-date device data with an extremely fast API. 51Degrees performs with better than 99.9% matching accuracy against more than 817,000 combinations of Device, Operating system, Browser and Apps.

The device detection service is made available to customers starting with Sitecore Version 9, provided to existing customers under valid maintenance contracts at no additional cost. This service is fully integrated and provides contextual and meaningful experiences.

Sitecore no longer provides regular updates to the Legacy device detection database and service is considered as deprecated.

In this article we will see  how to configure device detection service and how to Personalize site content for visitors with different devices.

Configuring Sitecore Device Detection

Sitecore Device Detection is enabled to use Sitecore services and the database provided by 51Degrees by default. The database downloads automatically when you start your Sitecore instance for the first time and takes approximately seven minutes. Your Sitecore instance is fully functional during this time, with the exception of the Processing server. This is because the relevant device data lookups are not in place for any interactions being processed until the database is downloaded.

You can, however, further customize your installation with several device detection configuration options available in  App_Config\Sitecore\DeviceDetection.Client\ Sitecore.CES.DeviceDetection.config file. These configurations include adding your own provider instead of 51 degrees, Enabling and disabling the service, setting the cache size and databaseupdatecheck interval.

The following error can occur in Sitecore XP log files during authentication on the CES Discovery service used to update the device detection database.

WARN  Authentication on CES Discovery service failed.
Exception: System.Net.WebException
Message: The remote server returned an error: (403) Forbidden.
Source: System
   at System.Net.HttpWebRequest.GetResponse()
   at Sitecore.CES.Client.WebClient.<>c__DisplayClass6_0.<ExecuteRequest>b__0()
   at Sitecore.CES.Client.WebClient.Execute[T](Func`1 action, String requestUri)
   at Sitecore.CES.Client.ResourceConnector`1.Request(String endpoint, Object[] parameters)
   at Sitecore.CES.Discovery.EndpointSource.GetEndpoint(String serviceName at Sitecore.CES.Discovery.EndpointSource.GetEndpoint(String serviceName)

To fix the above issue you need to install the below hotfix provided by the sitecore corresponding to your sitecore version


Note: These packages are specific to Sitecore XP versions. After applying the hotfix, you must not install any Sitecore XP updates until Sitecore includes the changes associated with the hotfix in a public update.

You can also find the error Could not update device detection database in the logs

ERROR Could not update device detection database
Exception: System.ArgumentNullException
Message: Null ids are not allowed.
Parameter name: endpointUri
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
   at Sitecore.CES.Client.WebClient.DownloadBinaryContent(String endpointUri, String resourcePath, DownladBinaryContentParameters parameters)
   at Sitecore.CES.DeviceDetection.Providers.FiftyOneDegrees.FiftyOneDeviceDetectionClient.GetNewerVersion()
   at Sitecore.CES.DeviceDetection.Providers.FiftyOneDegrees.FiftyOneDeviceDetectionClient.DoUpdate(String serviceName, String& newDatabasePath, String& newDatabaseVersion)
   at Sitecore.CES.DeviceDetection.Providers.DeviceDetectionClient.Update()

To download and update the device database Sitecore Device Detection requires access to Sitecore services. Therefore, you must open the HTTPS protocol on your firewall, either for the wildcard domain address * (if your firewall allows it), or for the following URLs:

Once the device detection is enabled and running successfully you could see the following personalization rules

These rules help your site adapt to different user devices. The Sitecore Device Detection Service uses the browser user agent string of visitors to identify their device and its properties. This information is automatically added to the Sitecore Experience Database (xDB) and used for reporting.

Some of the Device parameters that are captured in device database are

  1.  Browser
  2. Hardware model
  3.  Operating system
  4. Operating system vendor
  5. Hardware screen height


There are also more than 600 Sitecore Device Detection parameters in the device database. You can use them to further customize your Sitecore sites and adapt the presentation of them on different devices using the Rule Set Editor.


With the Experience Analytics tool you can see device reports and evaluate the traffic generated from different devices. Moreover,  you can see which device users generate more value for your business.

Device detection service gives the flexibility to add custom rules by offering the access to device detection api. With this API you can extend the Sitecore Experience Platform with your own custom solutions.


As a whole,  Sitecore device detection is one of the powerful feature that allows a web developer to create a responsive site, a marketer to personalize visitor experience and run campaigns for different devices.


About The Author

Leave a Reply