@kodfolk/vue3-fathom

1.0.7 • Public • Published

Fathom Analytics plugin for Vue 3

Use the excellent Fathom Analytics in your Vue project.

This is mostly a simple wrapper for fathom-client. So if you want more control, you can use that directly.

Installation

npm i @kodfolk/vue3-fathom

Usage

import { createApp } from 'vue';
import VueFathom from '@kodfolk/vue3-fathom';

const app = createApp({});

app.use(VueFathom, {
    siteID: 'your-site-id', // replace with your actual site id
    disabled: false, // set to true to disable tracking
    settings: {} // additional settings for Fathom
});

Now you're up and running! Nothing more needs to be done to track page views.

Additional functionality

// Track event
this.$fathom.trackEvent('eventName', { _value: 1 });

// DEPRECATED: Track goa
this.$fathom.trackGoal('eventName', 0);

// Enable tracking for user
this.$fathom.enableTrackingForMe();

// Block tracking for user
this.$fathom.blockTrackingForMe();

// Check if tracking is enabled for user
this.$fathom.isTrackingEnabled();

See fathom-client for more information regarding the API or take a look in the code for available methods.

Contributing

Feel free to open an issue or submit a pull request if you find a bug or want to add a feature.

Readme

Keywords

none

Package Sidebar

Install

npm i @kodfolk/vue3-fathom

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

8.96 kB

Total Files

4

Last publish

Collaborators

  • pierrepavlov