plausible-tracker
plausible-tracker copied to clipboard
Clarify setup for outbound click tracking
Sorry it's not very clear from your documentation if I need to add the additional .js file or if everything is already included in the module so when I switch on the option, the additional JS is included automatically.
"Outbound Link Click Tracking" is an enhanced measurement and not included in our default script. This is because we want to keep the default script as simple and lightweight as possible. The [additional enhanced measurements](https://plausible.io/docs/script-extensions) you can choose to add depending on your needs.
Detailed Description
Context
Possible Implementation
Just trying to work out the same thing. I'm currently using plausible-tracker and the <script> snippet and it looks like it might be double-counting.
@nztomas hi, it looks current repository is not actively maintained, so i've created my own implementation of plausible tracker for client side. You may check it at https://github.com/vitonsky/plausible-client
There you may just run next code to collect outbound clicks:
import { Plausible, enableAutoOutboundTracking } from 'plausible-client';
const plausible = new Plausible({
apiHost: 'https://plausible.io',
domain: 'example.org',
});
// Function returns cleanup callback and starts track outbound clicks
enableAutoOutboundTracking(plausible);
Thanks - this looks good. I like the trackEvent filter too. I have an open issue to work on a bug related to this which would be fixed by your package, so I'll amend it to try out plausible-client instead.