Skip to content

Commit

Permalink
Update ga
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Jan 10, 2020
1 parent f200b81 commit 5785b9f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/index.js
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 5785b9f

Please sign in to comment.