nuxt-modules / plausible

🎟️ Plausible Analytics integration for Nuxt
https://plausible.io
MIT License
102 stars 5 forks source link

Heads up: Plausible site verification tool #24

Open aerosol opened 1 month ago

aerosol commented 1 month ago

Hey,

just wanted to notify you about a new feature we'll be soon introducing in Plausible - a site verification tool allowing you to verify the integration.

It will employ a headless agent that visits the site and seeks for window.plausible() function being defined.

The signature is plausible(eventName, options) where options must be able to accept a callback key with a value of function({status}) - status is the HTTP status of /api/events response. The agent will send a custom event using that function. Otherwise the verification will be marked as failing.

Our tracker has been updated accordingly, as well as the npm package. If you like the nuxt module to be verifiable, please consider applying similar changes.

Many thanks!

Bcdo commented 2 weeks ago

This is related to the plausible integration not finding the Plausible snippet. I have followed the documentation for the integration, but Plausible seems to struggle with detecting the "snippet", which I guess gets auto-injected by the module?

aerosol commented 1 week ago

@Bcdo yup, since there is no snippet and no support for the callback I mentioned, our headless browser test can't tell if the test event was sent, thus making verification fail.

Bcdo commented 1 week ago

@aerosol Is there a workaround? Or do I need to install it manually outside the module for now?

johannschopplich commented 1 week ago

There is no workaround at the moment, because this package no longer uses the official `plausible-tracker' package, which seems to have been abandoned years ago. Instead, we use a maintained Plausible tracker rewrite by @Barbapapazes.

Barbapapazes commented 1 week ago

Is there any documentation page related to this new feature?

aerosol commented 1 week ago

@Barbapapazes hi, what sort of documentation do you require? I described the implementation details in the top post of this thread. Let me know if anything's unclear. Thanks.

Barbapapazes commented 1 week ago

After reading it again, I think it's clear. I will update my fork accordingly.

Barbapapazes commented 4 days ago

Hey, could you tell me if I well understand the site verification process? Thanks 🙌

https://github.com/Barbapapazes/plausible-tracker/pull/14/files#diff-fb108acf4e2165bea92e646b4d968ae7fd3c9b649376478cc8aa79f7be2966d3R9