0

We have a requirement to pass browser, OS, Device details to third party analytics (yes they don't capture by default).

Does sitecore provides any API which we can use to capture these details? Any alternate approach is fine as well.

2

Sitecore will capture information about the request in the analytics, but if you are just sending the data to the 3rd party analytics API you can probably just use the Request.Browser object that is just part of the MVC Controller request.

You could use the following properties

public ActionResult MyRendering() 
{
    var os = Request.Browser.Platform;
    var browserVersion = Request.Browser.Version;

    // Parse the UserAgent yourself or use a 3rd party to parse:
    var userAgent = Request.UserAgent;
}

If you don't get enough information from the properties, you could parse the UserAgent - use a service to give you consistent results. Something like: https://developers.whatismybrowser.com/

0

Sitecore offer access to the Device Detection API - you can use the class DeviceDetectionManager and the method GetDeviceInformation to get the device information such as:

  • Browser
  • DeviceType
  • DeviceOperatingSystemModel
  • HardwareDisplayHeight
  • HardwareDisplayWidth

For more information check this link: https://doc.sitecore.net/sitecore_experience_platform/developing/device_detection/api_reference_for_the_device_detection_service

  • 1
    Just a note tho - for the device detection to work you need to purchase the DeviceDetectionApp - if you have that purchased it is a good option. – Richard Seal Feb 6 '17 at 14:34
0

If the other website is a Sitecore website as well, you could have a look at the federated experience manager: https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/federated_experience_manager/the_federated_experience_manager

If not, I would build a simple Web API which exposes the Sitecore.Analytics database to the other website.

Edit: I wouldn't choose to send the analytics on every page load. When the external API is slow, your website gets slow as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.