Alternative to request.headers['user-agent']

I’m currently having problems with the request.headers[‘user-agent’] variable

There is another alternative in hubl to detect the client’s browser

it’s mandatory with hubl code

My code:
Only works with preview pages, it worked fine a couple of days ago

{% set agent = request.headers[‘user-agent’]|lower|string %}

{% set isMobile = agent is string_containing(“mobile”) ? true : false %}

Hi, Fernando_Aguila

Can you try this code :

{% set agent = request.headers['user-agent']|lower|string %}
{% set isMobile = agent is string_containing "mobile" ? true : false %}

Kind regards,

Matthieu

matthieu.berard@markentive.com