Solved

What is the best way to track the user agent?

  • 20 June 2023
  • 1 reply
  • 618 views

Hi, Amplitude does not track the browser (user agent) by default. What is the best way of doing that? I imagine just setting the plain user agent string into a user property might end up insufficient. Esp. when later trying to split it up into the actual browser (e.g. chrome, edge etc.) and exact versions etc. Any recommendations?

icon

Best answer by dangrainger 20 June 2023, 11:36

View original

1 reply

Userlevel 5
Badge +9

Hi @kornelius. In our setup we grab the user agent string using a little javascript in GTM, then pass the value as a user property in the Amplitude tag (Marketing Browser SDK). If you need to do anything with the value strings afterwards, you can use Derived Properties (https://help.amplitude.com/hc/en-us/articles/5874857623707-Derived-properties-Add-new-event-and-user-properties-retroactively) if you’re on the Enterprise plan. If you don’t have access to these, an alternative approach would be to manipulate the values ahead of sending them to user properties in the Amplitude events.

Hope this helps!

Reply