Thank you @Andriy_Konoz, I have tried this but cannot get it to return the data to be used in the API call. How would I do this?
This piece of code will return the browser name but not the rest of the information in the Facebook example. I will look for some code that can do the rest as I think it exists - I found this thread that helped -