-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(analytics.ts): ๐analytics setup
- Loading branch information
Showing
12 changed files
with
1,960 additions
and
1,900 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import { Box, Text } from '@chakra-ui/react'; | ||
|
||
function Home() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,31 @@ | ||
import { ENV } from '@/configs/env'; | ||
|
||
import { ENV } from '../../configs/env'; | ||
import { FacebookAnalytics } from './facebook'; | ||
import { GoogleAnalytics } from './google'; | ||
import { KakaoAnalytics } from './kakao'; | ||
|
||
const googleAnalytics = ENV.GA_KEY | ||
? new GoogleAnalytics(ENV.GA_KEY) | ||
: console.error('should set GA key'); | ||
|
||
const facebookAnalytics = ENV.FACEBOOK_PIXEL_KEY | ||
? new FacebookAnalytics(ENV.FACEBOOK_PIXEL_KEY) | ||
: console.error('should set facebook key'); | ||
|
||
const kakaoAnalytics = ENV.KAKAO_PIXEL_KEY | ||
? new KakaoAnalytics(ENV.KAKAO_PIXEL_KEY) | ||
: console.error('should set Kakao pixel key'); | ||
|
||
export const completeRegistrationAnalytics = (social: string) => { | ||
googleAnalytics?.completeRegistration(social); | ||
facebookAnalytics?.completeRegistration(social); | ||
kakaoAnalytics?.completeRegistration(social); | ||
}; | ||
|
||
export const startProjectAnalytics = (params: { id: string; step: string }) => { | ||
googleAnalytics?.startProject(params); | ||
facebookAnalytics?.startProject(params); | ||
kakaoAnalytics?.startProject(params); | ||
}; | ||
|
||
export const completeProjectAnalytics = (id: string) => { | ||
googleAnalytics?.completeProject(id); | ||
facebookAnalytics?.completeProject(id); | ||
kakaoAnalytics?.completeProject(id); | ||
}; | ||
|
||
export const consultingApplyAnalytics = () => { | ||
googleAnalytics?.consultingApply(); | ||
facebookAnalytics?.consultingApply(); | ||
kakaoAnalytics?.consultingApply(); | ||
}; | ||
|
||
export const requestApplyAnalytics = () => { | ||
googleAnalytics?.requestApply(); | ||
facebookAnalytics?.requestApply(); | ||
kakaoAnalytics?.requestApply(); | ||
import { Analytics } from './types'; | ||
|
||
/** | ||
* ํ์ํ์ง ์์ ๋ถ์ ๋๊ตฌ๋ ์ด ์ฝ๋์์ ์ ๊ฑฐํด์ฃผ์ธ์. | ||
* ๋จ์ผ ๋ถ์ ๋๊ตฌ๋ง ์ฌ์ฉํ ๊ฒฝ์ฐ, ํด๋น ๋๊ตฌ์ ๋ฉ์๋๋ฅผ ์ง์ ํธ์ถํ์ฌ ์ฌ์ฉํฉ๋๋ค. | ||
useEffect(() => { | ||
facebookAnalytics?.pageView({ content_name: 'page2', content_ids: [2] }); | ||
}, []) | ||
*/ | ||
|
||
export const googleAnalytics = new GoogleAnalytics(ENV.GA_KEY); | ||
export const facebookAnalytics = new FacebookAnalytics(ENV.FACEBOOK_PIXEL_KEY); | ||
export const kakaoAnalytics = new KakaoAnalytics(ENV.KAKAO_PIXEL_KEY); | ||
|
||
/** Google Analytics, Facebook Pixel, Kakao Pixel์ ๋ชจ๋ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์๋์ ํจ์๋ฅผ ๊ณตํต์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. */ | ||
export const completeRegistrationAnalytics = ( | ||
params: Analytics.CompleteRegistration, | ||
) => { | ||
googleAnalytics?.completeRegistration(params.Ga); | ||
facebookAnalytics?.completeRegistration(params.Fbq); | ||
kakaoAnalytics?.completeRegistration(params.Kakao); | ||
}; | ||
|
||
/** ๊ฐ ๋ถ์ ๋๊ตฌ์ ์ค์ ๋ฉ์๋๋ฅผ ํธ์ถํ๋ ํจ์๋ค์ ๋๋ค. */ | ||
export const GASetter = () => googleAnalytics?.GASetter(); | ||
export const FacebookSetter = () => facebookAnalytics?.FacebookSetter(); | ||
export const KakaoSetter = () => kakaoAnalytics?.KakaoSetter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.