1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-03-20 10:39:45 +01:00

add custom event tracking for chrome extension

This commit is contained in:
Kushagra Gour 2024-04-16 13:52:54 +05:30
parent e5220a6b95
commit 780cf21d76

View File

@ -10,6 +10,12 @@ export function trackEvent(category, action, label, value) {
}
if (window.ga) {
ga('send', 'event', category, action, label, value);
fetch('https://event-ajhkrtmkaq-uc.a.run.app', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ category, action, label, value })
});
}
}