0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Added trackEvent util for sending events to Plausible ()

This commit is contained in:
Nick Moreton 2023-05-18 14:32:50 +01:00 committed by GitHub
parent 8127a481ca
commit 14ce57fa2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,8 @@
// Wrapper function for Plausible event
export default function trackEvent(eventName, props = {}) {
window.plausible = window.plausible || function () {
(window.plausible.q = window.plausible.q || []).push(arguments);
};
window.plausible(eventName, {props: props});
}