Questions tagged [ahoy]

Ahoy provides a solid foundation to track visits and events in Ruby, JavaScript, and native apps.

Ahoy provides a solid foundation to track visits and events in Ruby, JavaScript, and native apps.

Works with any data store so you can easily scale.

http://ankane.github.io/ahoy/

70 questions
2
votes
2 answers

Ahoy events queries in rails

I started code rails recently and I need to figure out this problem. %td = Ahoy::Event.where(name: "viewed_brochure").where_properties(brochure_id: brochure.id).select(:session_id).uniq This should find number of distinct values of session_id in…
Emre
  • 119
  • 2
  • 8
2
votes
1 answer

How does Ahoy's visit work?

I want to track the visit clicking my links. I need to know the percentage of browser, OS... of every link. Does it mean I should add that in link.rb ? class Link < ActiveRecord::Base has_many :visits end But after clicking links lots of…
dalai
  • 51
  • 5
2
votes
2 answers

Create Seed Data for Analytics Ahoy gem

I want to create some seed data for Ahoy Analytics Gem for a demo How would I simulate page visits but also alter the date recorded in the db to simulate past visitor data? Any help is appreciated Thanks
Eali
  • 29
  • 6
2
votes
1 answer

How can I make ahoy's javascript asynchronous function track synchronous

I have some code which calls a function like this : function trackPDFSEClicks(){ ahoy.track("Viewed Job Spec", {title: "Viewed Software Engineer Job Spec"}); window.location.href = "/Software Engineer.pdf"; } However because…
RenegadeAndy
  • 5,440
  • 18
  • 70
  • 130
1
vote
2 answers

Instantiating and associating Ahoy::Visit for RSpec System Testing

Env Rails 7.0.4 Capybara 3.39.1 Rspec 3.12.2 Rspec Rails 6.0.2 AhoyMatey 4.2.1 General Context We have an app that uses current_visit as a stand-in user model when a user is not authenticated. We allow a user to "trial" the application, then…
crespire
  • 33
  • 1
  • 7
1
vote
0 answers

Ahoy gem filtering visit_token/visitor_token. Geolocation is NOT storing data in development/production database

The Ahoy gem is simply not storing any geo-location data in the database, and is returning [FILTERED] as the value for the visit_token and visitor_token. File Setup: rails_app/Gemfile: ruby "3.1.0" gem "ahoy_matey" gem "geocoder" gem "maxminddb"…
rebbailey
  • 714
  • 1
  • 7
  • 16
1
vote
0 answers

Getting intermittent 500 0 64 on IIS logs

I am not able to get rid of this particular 500 0 64 error which I see in my IIS logs. I keep on getting errors as shown below 2019-06-06 13:05:23 W3SVC10 POST /JsEvents/Events - 443 - HTTP/1.1…
prinkpan
  • 2,117
  • 1
  • 19
  • 32
1
vote
1 answer

Geocoder::Result::Geoip2#country returns nil even though location.data['country']['names']['en'] is not

I can't get Ahoy to work with Geocoder and the problem is related to this Ahoy line: module Ahoy class GeocodeV2Job < ActiveJob::Base [...] if location && location.country.present? # <= but my location.country is never present... This is really odd…
Darme
  • 6,984
  • 5
  • 37
  • 52
1
vote
1 answer

create a relationship between non User model and AhoyMessage

I am using Ahoy Email to track emails I send to my restaurants. However I'dd like to create a relationship like so : an AhoyMessage belongs_to a Restaurant a Restaurant has_many AhoyMessages so that I can access, for example:…
Uj Corb
  • 1,959
  • 4
  • 29
  • 56
1
vote
0 answers

How to track models using ahoy in rails

I integrated ahoy well. But my purpose is to track how many times any model show page visited. Let say i have 2 model CarModel and CarMake I want to tract visits like CarModel.first.visits and CarMake.first.visits But only solutions find is to hit…
Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133
1
vote
0 answers

ActiveJob not enqueuing job

I've implemented Ahoy for tracking events inside my application and I want to move the processing into a background job. My setup works fine when I call perform_now (the job gets processed), but changing to perform_later doesn't work. From the logs,…
Daniel Friis
  • 444
  • 3
  • 23
1
vote
1 answer

Rails - Querying a JSON Field

In my Rails 5 app, I'm using the Ahoy gem which uses a jsonb field (called properties) that I don't know how to query. A sample of the data in the properties field: "{\"id\":\"11\"}" What I'm trying to do is: Find the records created in the last…
yellowreign
  • 3,528
  • 8
  • 43
  • 80
1
vote
1 answer

In my rails application i am using action mailer to send mails to users. to track the mail if it is opened or clicked

To track if the mail is opened or clicked i am using ahoy_email. class UserMailer < ApplicationMailer track utm_campaign: "boom" default from: 'myemailid' def welcome_email(user) @user = user @url = 'linkofmywebsite' track user:…
Abhi
  • 11
  • 4
1
vote
0 answers

Rails 3 -> Ahoy plugin for user activity tracking-> Installation error

I have installed the Gem Ahoy as per the instruction in the link -> https://github.com/ankane/ahoy Add this line to your application’s Gemfile: gem 'ahoy_matey' And add the javascript file in app/assets/javascripts/application.js after jQuery. //=…
KavitaC
  • 635
  • 7
  • 29
1
vote
2 answers

Querying Ahoy Gem Events

I am using the Ahoy gem in a Rails 4.2 app. Ahoy Events stores events with a number of text attributes and a properties attribute that contains data I want to query. For example here is the last event I return via the rails console >>…
user2799827
  • 1,077
  • 3
  • 18
  • 54