-
Couldn't load subscription status.
- Fork 380
Open
Description
Ahoy is correctly working with my rails app, creating visits and events when a user moves from page to page. I now want to create more events for client-side actions, such as clicking a button, or having a heartbeat (to check for how long the user has been in the same page), so I followed the setup guide:
- Set
Ahoy.api = true - I tried both
yarn add ahoy.js+import ahoy from "ahoy.js"andpin "ahoy", to: "ahoy.js"+import "ahoy". - I added this bit of code to application.js:
document.addEventListener("turbo:load", () => {
ahoy.trackAll();
});
With the first importing method, I get the error
Uncaught TypeError: Failed to resolve module specifier "ahoy.js". Relative references must start with either "/", "./", or "../".
whilest with the second importing method I get
Uncaught TypeError: ahoy.trackAll is not a function
at HTMLDocument.<anonymous>
How can I solve this and get ahoy.js to work so that I can track client-side events?
Metadata
Metadata
Assignees
Labels
No labels