How can i get the browser name in perspective?

I notice the graphic loading is much faster in Chrome based browser than others like Firefox.
want to get the browser info, if it is not Chrome, will hide some chart to increase the loading time(initial)

Session props would be your best bet

session.props.device.userAgent

though the userAgent has been somewhat muddled by browser makers

here’s what my Firefox looks like

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0

and here is my Chrome one

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

further reading https://towardsdatascience.com/the-user-agent-that-crazy-string-underpinning-a-bunch-of-analytics-86507ef632f0

2 Likes

Can i just get the O.S. part of this tag?

I would parse it with a regular expression. What have you tried?

I’m thinking about an script that I saw, but it doesn’t work. (Get.os)

A Perspective script that tries to get this information anywhere else will get the OS of the gateway, not the client browser. Parse the session property.

1 Like

Depending on how much of it you want, I'd do a split and lookup in a custom session property
image

data
split({this.props.device.userAgent}, '[(|;|)]')

platform
{this.custom.userAgent.data}[1,0]

OS
{this.custom.userAgent.data}[2,0]

4 Likes

Sry for any Grammatical Issues in my english, i’m still learning…

More simple than just seems like, i tried the function form, in the binding expression, i just used a script that works like a filter to return the str(system):

OBS.: After copying the print here, i added some others conditions in the script what filters other O.S.

What do you guys think at all? For me,it worked.

Scripts and transforms are terribly inefficient. Use the expression bindings Jordan shows.

1 Like