Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-H3ZTJT4LNW');
gtag('config', 'G-H3ZTJT4LNW', {
debug_mode: true,
});
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions src/api/useKakaoShareUrl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect } from 'react';
import ReactGA from 'react-ga4';
import { useBottomSheet } from '@/components/common/BottomSheet/hooks';
interface KakaoShareUrlProps {
author: string;
Expand All @@ -21,6 +22,8 @@ export function useKakaoShareUrl({ author, shareUrl }: KakaoShareUrlProps) {
}

try {
ReactGA.event('poll_shared');

window.Kakao.Share.sendDefault({
objectType: 'feed',
content: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/LinkShareBottomSheet/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ReactGA from 'react-ga4';
import useToast from '../Toast/hooks';
import useGetMyInfo from '@/api/useGetMyInfo';
import { useKakaoShareUrl } from '@/api/useKakaoShareUrl';
Expand All @@ -22,6 +23,7 @@ export default function useLinkShareBottomSheet({
navigator.clipboard
.writeText(shareUrl)
.then(() => {
ReactGA.event('poll_shared');
toast.success({
title: '투표 주소가 복사됐어요!😉',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export default function PollRegistButton() {
onboardingStep: { ...myInfo.onboardingStep, FIRST_VOTE: false },
});
}

ReactGA.event('every_poll_created', {
post_id: data.postId,
});

const shareUrl = `${window.location.origin}/posts/${data.postId}?shareUrl=${data.shareUrl}`;
navigate(`/posts/${data.postId}`);
openBottomSheet(<PollCreatedShareBottomSheet shareUrl={shareUrl} />);
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react';
import ReactGA from 'react-ga4';
import { useNavigate } from 'react-router-dom';
import useGetMyInfo from '@/api/useGetMyInfo';
import { useGetNotificationPresent } from '@/api/useGetNotificationPresent';
Expand All @@ -19,6 +20,7 @@ export default function Home() {
const [isCoachMarkClosed, setIsCoachMarkClosed] = useState(false);

const handleCloseCoachMark = () => {
ReactGA.event('user_signup');
setIsCoachMarkClosed(true);
if (myInfo?.onboardingStep) {
updateOnboarding.mutate({
Expand Down