Instead of using the query string to indicate that the user is in app, consider switching that to a custom user agent or header.