Is there way to get the Device Type based on the User agent that can be used inside a JS policy?
I know apigee has the ability to find that out in the Analytics dashboard, but is there a service/policy that can used to figure that out?
Thanks,
Rajan
You could write a Javascript policy to detect device, browser type etc using the User-Agent header string as input. You would likely need to use a .js library to parse out the device type .
Within the .js policy,
get the UA string using: var uastr = context.getVariable('request.header.User-Agent');
Then pass the uastr into a js lib that parses for device type etc..
User | Count |
---|---|
7 | |
2 | |
2 | |
2 | |
1 |