PageSourceSearch

https://railsblocks.com/assets/controllers/analytics_controller-2e…47dc0187d26f88802eab3f9769e65f3171df85b1.js

js railsblocks.com collected 2026-09-25 20:22:35 UTC 439 bytes, 21 lines download raw bytes

1import { Controller } from "@hotwired/stimulus";
2
3export default class extends Controller {
4  static values = {
5    eventName: String,
6  };
7
8  track() {
9    if (!this.hasEventNameValue) return;
10
11    // Track with Fathom
12    if (typeof fathom !== "undefined") {
13      fathom.trackEvent(this.eventNameValue);
14    }
15
16    // Track with PostHog
17    if (typeof posthog !== "undefined") {
18      posthog.capture(this.eventNameValue);
19    }
20  }
21};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.