Reader

A privacy-first, data-driven approach to optimize the user experience: Introducing Geolocation Insights in Frontend Observability

| engineering on Grafana Labs | Default

Grafana Cloud Frontend Observability is a real user monitoring (RUM) solution that provides immediate, clear, and actionable insights into the end-user experience of web applications. Understanding where those end users are located can provide valuable insights into frontend performance, error patterns, and overall user experience. 

This is why we’re introducing Geolocation Insights in Frontend Observability, a feature that lets you filter, segment, and analyze frontend telemetry based on location data. With these new capabilities, you can further optimize web performance, localize content, and tailor your end-user experiences — all while incorporating the principles of Privacy by Design

Read on to learn more about why geolocation data is important; how we designed Geolocation Insights to help comply with GDPR, ePrivacy, and other data privacy regulations; and how to get started with the feature in Grafana Cloud. You can also watch a demo of Geolocation Insights in the video below.

Geolocation data: why it matters matters and how to use it in Frontend Observability 

The frontend performance of an application is often influenced by an end user’s location in relation to the underlying infrastructure, such as CDN nodes and backend services, that supports that application.

This means, when SREs or developers want to evaluate frontend performance, they often find themselves asking: 

  • Where are our end users located, and how exactly does their location impact performance?
  • Are slow load times concentrated to specific regions?
  • Do we need to optimize our infrastructure for certain geographical areas?
  • Can we track errors by location to identify regional issues?

Now, with Geolocation Insights in Frontend Observability, your team can easily find answers to these questions (and more). 

Specifically, you can use this new geolocation feature to:

  • Filter frontend telemetry by continent, country, subdivision, city, and network.
  • Use embedded breakdowns to understand performance variations by region.
  • Identify location-based error trends to optimize debugging and support.
  • Visualize real-time geolocation data in your Grafana Cloud dashboards.

Privacy by Design: Protecting end-user data 

To help ensure compliance with GDPR, ePrivacy, CCPA, and other privacy regulations, we built Geolocation Insights using the principles of Privacy by Design, an engineering approach that embeds privacy and data protection into the design of applications from the very beginning.

Unlike some traditional geolocation tracking methods, our privacy-first approach uses an offline geolocation database (MaxMind) within our infrastructure, meaning no IP addresses are sent to external services. In addition, Geolocation Insights offers:

  • Anonymization and data minimization: Geolocation Insights does not store IP addresses. Instead, IPs are used temporarily and processed locally, within the end user’s browser, and discarded immediately after deriving location data.
  • Double Opt-in consent and configurable granularity: Geolocation tracking is disabled by default to provide full control over data collection. To activate it, you must enable the feature in both the Grafana Cloud Frontend Observability UI and the Web SDK configuration. When enabled in Grafana Cloud, you can specify the desired level of granularity (e.g., continent, country, subdivision, city, and network). By default, the feature collects data at the country level. To fully activate geolocation tracking, the Web SDK must also be configured to explicitly include this setting on the end user facing application.
  • Strict retention policies: By default, geolocation metadata follows the standard 30-day retention policy for logs and traces.
  • Role-Based Access Control (RBAC): Geolocation data access is managed via Grafana’s RBAC system, ensuring only authorized users can query location data.

Note: Opt-in consent, where applicable, at the end user level remains your responsibility to implement. We have introduced a mechanism in Grafana Faro, the open source Web SDK that powers Frontend Observability, that retrieves information on a per-user basis, allowing the opt-in decision to be on the end user. It is not possible for an end user to enable geolocation if you have disabled the feature in Grafana Cloud. Furthermore, when an end user dismisses or denies the opt-in consent process, no geolocation data is collected. For geolocation tracking to take effect in existing applications, changes in the SDK configuration are required.

Getting started with Geolocation Insights

You can enable Geolocations Insights within Frontend Observability for both existing and new applications by following these steps: 

Existing applications:

  1. Navigate to your app in Frontend Observability and select it.
  2. Click on the Settings tab.
  3. Toggle Enable Geolocation and, optionally, select the desired granularity.
  4. Exclude specific country tracking by adding it to the Denylist.
  5. The settings are automatically saved.
  6. Click Configure SDK and copy the code snippet to your own application for changes to take effect.

New applications:

  1. Navigate to Frontend Observability and click Create New.
  2. While creating a new app, enable geolocation and choose the granularity level if needed.
  3. Add selected countries to the Denylist to have those excluded from location tracking.
  4. The SDK configuration will automatically be adjusted to reflect the selected options.
  5. Complete your setup and geolocation telemetry data will start being captured.

Visualizing geolocation data

Once you’ve enabled Geolocation Insights, you can visualize your geolocation metadata in Grafana Cloud dashboards. More specifically, you can:

  1. Use breakdown charts to analyze user distribution.
A screenshot of a breakdown chart to analyze user distribution.
  1. Apply filters to investigate regional performance trends.
A screenshot showing a dashboard with filters applied.
  1. View error reports by location to pinpoint issues.
A screenshot of a dashboard that displays errors by location.
  1. Use the Geo Panel for interactive geographic visualizations.
A screenshot showing the Geo Panel for interactive geographic visualizations.

Wrapping up

Geolocation Insights is designed to help you better understand your frontend performance and end-user experience. Whether you’re troubleshooting errors, optimizing performance, or making data-driven business decisions, this feature empowers you to have the visibility you need, while remaining fully committed to user privacy and trust.

You can learn more about Geolocation Insights in our technical docs. You can also use this detailed setup guide to get started with Frontend Observability in Grafana Cloud, if you haven’t already. We hope you’ll try it out today!

Lastly, a special thanks to Kostas Pelelis, senior software engineer at Grafana Labs; Bukola Ayodele, senior developer advocate at Grafana Labs; and Brie Mignano, senior product designer at Grafana Labs for the creative collaboration that helped bring the images and demo video in this post to life.

Grafana Cloud is the easiest way to get started with Frontend Observability. We have a generous forever-free tier that includes 50k frontend sessions. Sign up for free now!