Monday, June 9, 2025
News PouroverAI
Visit PourOver.AI
No Result
View All Result
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing
News PouroverAI
No Result
View All Result

Visualizing Ahoy analytics in Rails

February 12, 2024
in Front-Tech
Reading Time: 3 mins read
0 0
A A
0
Share on FacebookShare on Twitter



At Honeybadger, we utilize Ahoy for first-party analytics in Rails. Ahoy is highly beneficial for developers because it operates within your Rails application alongside your other data and code. Need to address a specific question about your product or website visitors? It’s just one ActiveRecord query away: Ahoy::Event.where_event(“$view”, page: “https://www.honeybadger.io/”).count

Ahoy also seamlessly integrates with Chartkick and Groupdate to visually represent your data. For instance, after installing these two libraries, you can add a chart of all page views to any Rails view: <%= line_chart Ahoy::Event.where_event("$view", page: "https://www.honeybadger.io/").group_by_hour(:time).count %>

The provided code generates a chart similar to this: Charting Ahoy data with Chartkick. Ahoy and Chartkick are excellent tools for tracking analytics and building dashboards. However, the drawback is that you must deploy your app to make changes. If you find yourself frequently deploying to update your dashboards, you might consider using Blazer. Blazer allows you to explore your data, create charts, and build dashboards using SQL. Screenshot from Blazer README.

Nevertheless, working with SQL can be complex. At Honeybadger, we have used the Ahoy+Chartkick+Blazer stack for years and recently enhanced Ahoy’s data store to send events to Honeybadger Insights. This integration enables us to explore our web analytics, create dashboards, and combine them with our other observability data. Integrating Ahoy with Honeybadger Insights.

Honeybadger Insights is a new logging/observability tool that we will soon be launching at Honeybadger. With Honeybadger Insights, you can utilize our query language, BadgerQL, to delve into your Honeybadger data (errors, uptime events, etc.) and generate charts and dashboards using BadgerQL queries. Additionally, you can send us your application logs and custom events to consolidate all your data in one location.

To integrate Ahoy with Honeybadger Insights and create a chart similar to Chartkick using BadgerQL, follow these steps:
1. If you haven’t already, install the honeybadger gem by following the Rails integration instructions.
2. If you already use the honeybadger gem, it is recommended to upgrade to the latest version. Ensure that the honeybadger gem in your Gemfile is pinned to version ~> 5.5: # Gemfile gem “honeybadger”, “~> 5.5” Then update to the latest version: bundle update honeybadger
3. Open config/initializers/ahoy.rb in a text editor and modify the default Ahoy::Store to resemble the following code:

class Ahoy::Store < Ahoy::DatabaseStore def track_visit(data) Honeybadger.event("ahoy_visit", data) super(data) end def track_event(data) Honeybadger.event("ahoy_event", data) super(data) end def geocode(data) Honeybadger.event("ahoy_geocode", data) super(data) end def authenticate(data) Honeybadger.event("ahoy_authenticate", data) super(data) end end That's all. To test in your development environment, you can run rails server with the HONEYBADGER_REPORT_DATA=true environment variable to temporarily disable Honeybadger's development mode. Use the following command: HONEYBADGER_REPORT_DATA=true rails server As Ahoy collects events, you should be able to see them on the Insights tab in your Honeybadger project: Ahoy events in Honeybadger Insights To create a chart similar to the Chartkick example mentioned earlier, enter the following BadgerQL into the query box and click Search: filter event_type::str == "ahoy_event" | filter name::str == "$view" | stats count() by bin(1h) as date | fill date step 1h | sort date For a detailed explanation of the BadgerQL used in this query, refer to the screencast on YouTube. Finally, switch the Line button to visualize the data as a line chart: Ahoy chart in Honeybadger Insights By sending our Ahoy data to Insights, we can analyze our web/product analytics and user events in the same place as our observability data. This is a significant upgrade for product-led teams like ours. If this resonates with you, feel free to check it out! Send us an email to join the beta or sign up to be notified when it launches for everyone (rest assured, we won't use your email for any other purpose).


Source link

Tags: AhoyanalyticsRailsVisualizing
Previous Post

Want to beat the stock market in 2024? Here’s how to do it, according to BofA.

Next Post

Paytm confirms resignation of Manju Agarwal from Paytm Payments Bank board; cites personal commitments

Related Posts

The essential principles of a good homepage
Front-Tech

The essential principles of a good homepage

June 7, 2024
How to measure and improve user retention
Front-Tech

How to measure and improve user retention

June 6, 2024
Push Animation on Grid Items
Front-Tech

Push Animation on Grid Items

June 5, 2024
How to build a Rails API with rate limiting
Front-Tech

How to build a Rails API with rate limiting

June 4, 2024
Introduction to the B.I.A.S. framework
Front-Tech

Introduction to the B.I.A.S. framework

June 3, 2024
Blue Ridge Ruby is exactly what we need
Front-Tech

Blue Ridge Ruby is exactly what we need

June 3, 2024
Next Post
Paytm confirms resignation of Manju Agarwal from Paytm Payments Bank board; cites personal commitments

Paytm confirms resignation of Manju Agarwal from Paytm Payments Bank board; cites personal commitments

How 101 Blockchains’ Prompt Engineering Certification is Different from Others?

How 101 Blockchains' Prompt Engineering Certification is Different from Others?

Ecommerce Replatforming Checklists (10 Project Stages)

Ecommerce Replatforming Checklists (10 Project Stages)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest
23 Plagiarism Facts and Statistics to Analyze Latest Trends

23 Plagiarism Facts and Statistics to Analyze Latest Trends

June 4, 2024
Managing PDFs in Node.js with pdf-lib

Managing PDFs in Node.js with pdf-lib

November 16, 2023
Accenture creates a regulatory document authoring solution using AWS generative AI services

Accenture creates a regulatory document authoring solution using AWS generative AI services

February 6, 2024
Salesforce AI Introduces Moira: A Cutting-Edge Time Series Foundation Model Offering Universal Forecasting Capabilities

Salesforce AI Introduces Moira: A Cutting-Edge Time Series Foundation Model Offering Universal Forecasting Capabilities

April 3, 2024
The Importance of Choosing a Reliable Affiliate Network and Why Olavivo is Your Ideal Partner

The Importance of Choosing a Reliable Affiliate Network and Why Olavivo is Your Ideal Partner

October 30, 2023
Programming Language Tier List

Programming Language Tier List

November 9, 2023
Can You Guess What Percentage Of Their Wealth The Rich Keep In Cash?

Can You Guess What Percentage Of Their Wealth The Rich Keep In Cash?

June 10, 2024
AI Compared: Which Assistant Is the Best?

AI Compared: Which Assistant Is the Best?

June 10, 2024
How insurance companies can use synthetic data to fight bias

How insurance companies can use synthetic data to fight bias

June 10, 2024
5 SLA metrics you should be monitoring

5 SLA metrics you should be monitoring

June 10, 2024
From Low-Level to High-Level Tasks: Scaling Fine-Tuning with the ANDROIDCONTROL Dataset

From Low-Level to High-Level Tasks: Scaling Fine-Tuning with the ANDROIDCONTROL Dataset

June 10, 2024
UGRO Capital: Targeting to hit milestone of Rs 20,000 cr loan book in 8-10 quarters: Shachindra Nath

UGRO Capital: Targeting to hit milestone of Rs 20,000 cr loan book in 8-10 quarters: Shachindra Nath

June 10, 2024
Facebook Twitter LinkedIn Pinterest RSS
News PouroverAI

The latest news and updates about the AI Technology and Latest Tech Updates around the world... PouroverAI keeps you in the loop.

CATEGORIES

  • AI Technology
  • Automation
  • Blockchain
  • Business
  • Cloud & Programming
  • Data Science & ML
  • Digital Marketing
  • Front-Tech
  • Uncategorized

SITEMAP

  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2023 PouroverAI News.
PouroverAI News

No Result
View All Result
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing

Copyright © 2023 PouroverAI News.
PouroverAI News

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In