Browser: A browser detection in Go v1.0.0

https://github.com/dineshgowda24/browser

What does it do?

The browser Go Package is designed to parse user agent strings, providing valuable insights into the user’s browser, device, and operating platform. This Package simplifies the often intricate process of user agent analysis and proves particularly beneficial for web applications that require customized responses based on the client’s characteristics.

Why was it created?

This project was born out of practical need. We encountered situations where it was essential to identify the client’s browser, device, and platform.

One significant application was the creation of an in-house URL shortener, complete with deep linking and universal linking capabilities. These shortened URLs were used for marketing campaigns across various social media platforms and for sending notifications through different channels like WhatsApp. The uniqueness of this URL shortener lies in its ability to adapt to multiple client scenarios:

  1. Enhanced Link Engagement: Unlike typical URL shorteners that redirect to the target URL when opened in a browser, this service ensures that shared links on social media platforms appear more engaging. It achieves this by returning plain HTML with Open Graph (OG) tags, making the URL’s content rich and enticing to click on, especially when the client is not an actual browser, i.e. for bots/link expanding requests from social media sites. This approach significantly improves Click-Through Rates (CTR).
  2. Platform-Based Redirection: Besides mere redirection, this project allows for platform-specific redirection to app stores, making it ideal for app-only links. This is a feature not commonly found in generic URL shorteners.
  3. Search Engine Optimization (SEO): To optimize SEO, rendering content differently for Google bots is often necessary. This project facilitates that, ensuring the backend API responds appropriately when Google bots access the site.
  4. Analytics: The Package also serves as a valuable tool for analytics related to short links. It enables tracking client information, including the browser, device, and platform, for informed product decisions and other strategic considerations.

Why it’s useful, especially compared to similar existing projects?

This Package stands out for several reasons:

  1. Robust Data Backing: The Package is supported by a comprehensive database of user agents bought from https://www.whatismybrowser.com/. With access to a database containing 250 million user agents, testing clients across various devices and platforms is straightforward and reliable.
  2. Extensive Client Support: The project offers support for a comprehensive list of browsers, devices, platforms, and bots, making it versatile and accommodating of diverse client scenarios.
  3. Code Extensibility: It’s easy to extend the Package to support new clients with minimal code changes, ensuring that adding new features doesn’t disrupt existing functionality.
  4. Thorough Testing: The project includes a substantial number of unit tests, assuring the reliability and stability of its functionality.
1 Like

Interesting. I’m actually using avct/uasurfer for one of my projects but I believe it’s not being actively maintained. I might give this a try if it sees active development long-term.

I am planning to maintain it long-term depending on how well the adoption is in the community. I have a few more features released in the next few weeks.

Yes, uasurfer is not maintained.

Also, I liked the uasurfer readme; I have to add the list of browsers, platforms, devices and bots supported in the package, as it would give better visibility to the user.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.