BeaconCMS/beacon

Proposal: Plausible integration as a plugin

leandrocp opened this issue · 1 comments

Plausible is an open-source and privacy-friendly analytics solution that should effortlessly integrate with Beacon.

Not every site site will make use of Plausible which leads us to propose that integration as a plugin beacon_plausible or a similar name. We still don't have any plugin for Beacon, that would be the first one and serve as a template for future plugins.

The 2 main reasons for providing this plugin:
1 - Beacon should handle adblockers with a reverse proxy
2 - POST events from within that proxy to submit custom properties

In summary this plugin must:
1 - Inject the <script> tag into header that will redirect requests to the reverse proxy
2 - Implement the reserve proxy that respond to the following requests: script.js, POST /api/event
3 - Use the manual extension to have control over events
4 - POST pageview events in the after_render_template lifecycle stage

Note that this level of control is what enable us to have support for A/B testing

PlausibleProxy fulfills this requirement.