Customizing User Agent

User Agent

Custom User Agent is an identifier sent by a browser or app to a website. It tells the website details about the device, operating system, and browser to help ensure a smooth experience across all devices. Imagine you are walking to a building and wear a badge, “Hi, I’m Rahul. I’m on an Android phone. I use Chrome browser.” The building staff (the website) reads your badge and decides how to treat you - what door to open, which desk to send you to, what content to show you. A User Agent is exactly that badge, a small piece of text your app automatically sends to every website it opens, telling the website: “Hey, here’s who I am and what device I’m on.”


Group 2147203991.webp


Two Modes - Which One Is Perfect for You?

Append

Keeps the original device info and adds your custom identifier at the end. Your website still knows the device type, plus now recognizes your app. Mozilla/5.0 Chrome/120 Android My App/2.0 **Best for most users -** Use this if you want your server to tell the difference between app users and web users

Custom

Wipes the default user after completely and replaces it with whatever string you type. Full control - but the website loses device info unless you include it yourself. MyBrand -iOS - App/ 3.0 **Advanced Use -** For teams who want a completely branded or purpose-built identifier string.

Steps to Integrate User Agent

Website Overrides

Select Website Overrides from the left menu of the WebToNative Dashboard.


User Agent

Clicking on the Configure button opens a pop-up to integrate the Custom User Agent. There are two options for selecting the User Agent type for your app.

1. Append - Append adds extra information to the existing user agent string. It lets you include additional identifiers without replacing the original user agent.


Without User Agent

Your app sends the default device browser string: Mozilla/5.0 (Linux: Android 13; Pixel 7) App leWebKit/537.36 Chrome/120.0.0.0 Mobike Safari/537.36

With User Agent (Append )

Your app sends the default string + your custom tag: Mozilla/5.0 (Linux: Android 13; Pixel 7) App leWebKit/537.36 Chrome/120.0.0.0 Mobike Safari/537.36 MyApp/2.0

Custom

It allows you to replace the default user agent string with your own. This provides full control over the user agent to customize how the app behaves.

Save

Press the “Save” button to store your updates.


Rebuild

Press Rebuild to update the website with your changes.

This is the default identity your app or browser sends to a website, and you can customize your entire user agent string using a custom option.