diff --git a/src/index.js b/src/index.js index 06d1ccf..9a0f4bf 100644 --- a/src/index.js +++ b/src/index.js @@ -121,11 +121,6 @@ let memoFormSubmit; document.querySelector('form').addEventListener('submit', function (e) { e.preventDefault(); - ga('send', 'event', { - eventCategory: 'V2M', - eventAction: 'convert' - }); - NProgress.start(); const formElement = e.currentTarget; @@ -135,6 +130,12 @@ document.querySelector('form').addEventListener('submit', function (e) { const showPlayIcon = formElement.querySelector('[name="show-play-icon"]').checked; const newMemoFormSubmit = `${videoUrl}|${showPlayIcon}`; + ga('send', 'event', { + eventCategory: 'V2M', + eventAction: 'convert', + eventLabel: videoUrl + }); + if (memoFormSubmit === newMemoFormSubmit) { updateMarkdown(title); NProgress.done();