Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

팝업 GA 이벤트 추가 #181

Merged
merged 3 commits into from
Dec 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
✨ 팝업 GA 이벤트 추가
  • Loading branch information
anxiubin committed Dec 7, 2021
commit a678e2e799ce4140b61e632264def3c59ad9aaf1
9 changes: 9 additions & 0 deletions src/popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { getAccessToken } from '@utils/http/auth'
window.addEventListener('DOMContentLoaded', () => {
if (getAccessToken()) {
const categoryListElement = document.getElementById('categoryList')
const urLinkOpenElement = document.getElementById('urLinkOpen')
const categoryCreateButtonElement = Template.categoryCreateButton()
const categoryCreateInputWrapperElement = Template.categoryCreateInputWrapper()
const categoryItemListWrapperElement = Template.categoryListWrapper()
Expand All @@ -27,6 +28,8 @@ window.addEventListener('DOMContentLoaded', () => {
EventSetting.categoryCreateCancelEventSetting()

EventSetting.linkSaveEventSetting()

urLinkOpenElement.addEventListener('click', () => window.ga('send', 'event', '팝업', '팝업_유어링크 열기'), false)
} else {
document.getElementById('categoryList').innerHTML = Template.loginRequired()
}
Expand Down Expand Up @@ -58,6 +61,7 @@ const EventListener = {
currentCategoryElement.classList.add('check')
if (!linkSaveElement.classList.contains('active')) linkSaveElement.classList.add('active')
linkSaveElement.dataset.categoryId = data.id
window.ga('send', 'event', '팝업', '팝업_카테고리 선택')
},

categoryCreateButtonEventListener(e) {
Expand All @@ -68,6 +72,7 @@ const EventListener = {
categoryCreateInputWrapperElement.classList.remove('hide')
const enterCategoryNameInputElement = document.getElementById('enterCategoryNameInput')
enterCategoryNameInputElement.focus()
window.ga('send', 'event', '팝업', '팝업_카테고리 생성 텍스트 입력창으로 토글')
},

categoryCreateCancelEventListener(e) {
Expand All @@ -78,6 +83,7 @@ const EventListener = {
categoryCreateInputWrapperElement.classList.add('hide')
const enterCategoryNameInputElement = document.getElementById('enterCategoryNameInput')
enterCategoryNameInputElement.value = ''
window.ga('send', 'event', '팝업', '팝업_카테고리 생성 취소')
},

async categoryCreateOkEventListener(e) {
Expand All @@ -96,6 +102,7 @@ const EventListener = {
await APILoad.categoryListAppend()
popupMessage({ message: '카테고리가 생성 되었습니다.' })
enterCategoryNameInputElement.value = ''
window.ga('send', 'event', '팝업', '팝업_카테고리 생성 완료')
}
} catch (error) {
popupMessage({ message: error.message })
Expand All @@ -120,6 +127,7 @@ const EventListener = {
await APILoad.categoryListAppend()
popupMessage({ message: '카테고리가 생성 되었습니다.' })
enterCategoryNameInputElement.value = ''
window.ga('send', 'event', '팝업', '팝업_카테고리 생성 완료')
}
}
} catch (error) {
Expand All @@ -141,6 +149,7 @@ const EventListener = {
if (data?.length) {
categoryCardElement.classList.add('upload-finish')
popupMessage({ message: '링크가 이동 되었습니다.' })
window.ga('send', 'event', '팝업', '팝업_링크 저장')
}
await APILoad.categoryListAppend()
} catch (error) {
Expand Down