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 (#16824)
This commit is contained in:
parent
8127a481ca
commit
14ce57fa2b
1 changed files with 8 additions and 0 deletions
8
ghost/admin/app/utils/analytics.js
Normal file
8
ghost/admin/app/utils/analytics.js
Normal 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});
|
||||
}
|
Loading…
Add table
Reference in a new issue