Custom User Agent

📘

You may choose to serve a different version of your website or make changes to your website based on the user agent.

By default, we append the following strings to the end of the user's default user agent on their device:

In the iOS app the user agent is appended with GoNativeIOS/1.0 gonative
In the Android app the user agent is appended with GoNativeAndroid/1.0 gonative

You may specify your own custom user agent by selecting the Custom option and then providing your custom user agent.

The user agent is sent in the headers of each HTTP request coming from the app. You can then recognize the request is coming from the app by checking if it contains gonative. This is useful if you want to serve different CSS, JS, or other resource files only in your apps, but not your regular website.

You may also access the user agent directly via javascript with navigator.userAgent. To filter logic in javascript, you might use:

if (navigator.userAgent.indexOf('gonative') > -1) {
  // do something
}

Next Steps