@daeryun/dr_components 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/components/Daeryuntalk/_hooks/talkprovider/useWorkFlow.js +4 -4
  2. package/dist/components/Daeryuntalk/_hooks/talkprovider/useWorkFlow.ts +4 -4
  3. package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.js +4 -4
  4. package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.ts +4 -4
  5. package/dist/components/Fix/index.jsx +10 -10
  6. package/dist/components/Fix/index.tsx +10 -10
  7. package/dist/components/Footer/index.jsx +4 -4
  8. package/dist/components/Footer/index.tsx +4 -4
  9. package/dist/components/Menu/MobileMenu.jsx +1 -1
  10. package/dist/components/Menu/MobileMenu.tsx +1 -1
  11. package/dist/components/Menu/PCMenu.jsx +1 -1
  12. package/dist/components/Menu/PCMenu.tsx +1 -1
  13. package/dist/components/Seo/SeoAdditionalLink.jsx +2 -2
  14. package/dist/components/Seo/SeoAdditionalLink.tsx +2 -2
  15. package/dist/components/Seo/SeoConsulting.jsx +3 -3
  16. package/dist/components/Seo/SeoConsulting.tsx +3 -3
  17. package/dist/components/hook/useLoginUuidSync.d.ts +0 -8
  18. package/dist/components/hook/useLoginUuidSync.js +78 -87
  19. package/dist/components/hook/useLoginUuidSync.ts +95 -95
  20. package/dist/components/index.js +1 -1
  21. package/dist/components/index.ts +1 -1
  22. package/dist/components/page/Choice/Choice.jsx +4 -4
  23. package/dist/components/page/Choice/Choice.tsx +4 -4
  24. package/dist/components/page/ConsultComplete/ConsultComplete.jsx +3 -3
  25. package/dist/components/page/ConsultComplete/ConsultComplete.tsx +3 -3
  26. package/dist/components/page/LawyerDetail/component/BasicInfo.jsx +1 -1
  27. package/dist/components/page/LawyerDetail/component/BasicInfo.tsx +1 -1
  28. package/dist/components/page/Login/LoginComp/LoginContainer.jsx +17 -26
  29. package/dist/components/page/Login/LoginComp/LoginContainer.tsx +17 -28
  30. package/dist/components/page/Login/StepOne.jsx +11 -12
  31. package/dist/components/page/Login/StepOne.tsx +18 -18
  32. package/dist/components/page/Login/StepTwo.jsx +11 -12
  33. package/dist/components/page/Login/StepTwo.tsx +16 -17
  34. package/dist/components/page/Login/Withdraw.jsx +1 -1
  35. package/dist/components/page/Login/Withdraw.tsx +1 -1
  36. package/dist/components/page/SuccessNew/components/SeoAdditionalLink.jsx +2 -2
  37. package/dist/components/page/SuccessNew/components/SeoAdditionalLink.tsx +2 -2
  38. package/dist/lib/gtag.d.ts +5 -3
  39. package/dist/lib/gtag.js +17 -26
  40. package/dist/lib/handleGtagClick.d.ts +3 -3
  41. package/dist/lib/handleGtagClick.js +5 -5
  42. package/dist/lib/handleGtagClick.ts +6 -6
  43. package/dist/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +1 -1
@@ -88,16 +88,6 @@ const LoginContainer = ({
88
88
  }
89
89
  };
90
90
 
91
- // GA 이벤트: 로그인 완료 (useLoginUuidSync.ts 훅에서 처리)
92
- // const loginCompleteGAEvent = (userId: string) => {
93
- // gtag.event({
94
- // action: 'login_complete',
95
- // category: 'login',
96
- // label: `로그인 완료 - ${userId}`,
97
- // value: '1'
98
- // });
99
- // };
100
-
101
91
  useEffect(() => {
102
92
  if (!isCheckRecentLogin) {
103
93
  return;
@@ -140,9 +130,6 @@ const LoginContainer = ({
140
130
  const normalized = redirect ? (redirect.startsWith('/') ? redirect : `/${redirect}`) : '/';
141
131
  const finalUrl = appendUuidToRedirect(normalized, String(idx ?? ''));
142
132
 
143
- // GA 이벤트
144
- // loginCompleteGAEvent(String(idx ?? '')); useLoginUuidSync.ts 훅에서 처리
145
-
146
133
  clearInterval(interval);
147
134
  window.location.href = finalUrl;
148
135
  return;
@@ -176,9 +163,6 @@ const LoginContainer = ({
176
163
  const normalized = redirect ? (redirect.startsWith('/') ? redirect : `/${redirect}`) : '/';
177
164
  const finalUrl = appendUuidToRedirect(normalized, String(idx ?? ''));
178
165
 
179
- // GA 이벤트
180
- // loginCompleteGAEvent(String(idx ?? '')); useLoginUuidSync.ts 훅에서 처리
181
-
182
166
  window.location.href = finalUrl;
183
167
  } else {
184
168
  const loginUrl = `https://oauth.daeryunlaw.com/login/${type}?clientKey=${clientKey}&${
@@ -236,14 +220,14 @@ const LoginContainer = ({
236
220
  }
237
221
  ];
238
222
 
239
- const snsLoginClickGAEvent = (snsLoginProvider: 'kakao' | 'google' | 'naver' | 'apple') => {
240
- gtag.event({
241
- event_name: 'sns_login_click',
242
- login_category: `${snsLoginProvider}_sns_login`,
243
- event_label: `${snsLoginProvider} login button clicked`,
244
- sns_login_click_value: '1'
245
- });
246
- };
223
+ // const snsLoginClickGAEvent = (snsLoginProvider: 'kakao' | 'google' | 'naver' | 'apple') => {
224
+ // gtag.event({
225
+ // event_name: 'sns_login_click',
226
+ // login_category: `${snsLoginProvider}_sns_login`,
227
+ // event_label: `${snsLoginProvider} login button clicked`,
228
+ // sns_login_click_value: '1'
229
+ // });
230
+ // };
247
231
 
248
232
  return (
249
233
  <section className={layoutClassName}>
@@ -270,9 +254,11 @@ const LoginContainer = ({
270
254
  ' max-sm:label_medium2_tb max-sm:mt-[8px] '
271
255
  }
272
256
  >
273
- <p>SNS 간편 가입으로 쉽고 빠른 로그인이 가능합니다.
274
- <br />
275
- 로그인하고 나의 사건 진행 상황을 확인하세요!</p>
257
+ <p>
258
+ SNS 간편 가입으로 쉽고 빠른 로그인이 가능합니다.
259
+ <br />
260
+ 로그인하고 나의 사건 진행 상황을 확인하세요!
261
+ </p>
276
262
  </div>
277
263
  </div>
278
264
  <div
@@ -288,7 +274,10 @@ const LoginContainer = ({
288
274
  aria-label={`${item.identityProvider} 로그인 버튼`}
289
275
  key={index}
290
276
  type="button"
291
- onClick={() => {handleLoginClick(item.identityProvider); snsLoginClickGAEvent(item.identityProvider); }}
277
+ onClick={() => {
278
+ handleLoginClick(item.identityProvider);
279
+ // snsLoginClickGAEvent(item.identityProvider);
280
+ }}
292
281
  // onClick={() => {snsLoginClickGAEvent(item.identityProvider); }}
293
282
  className={
294
283
  ' relative flex h-[72px] w-[540px] items-center ' +
@@ -13,7 +13,6 @@ import Image from 'next/image';
13
13
  import { useMutation } from '@tanstack/react-query';
14
14
  import { getCookie, setCookie } from '../../../lib';
15
15
  import ConfirmModal from './LoginComp/Modal/ConfirmModal';
16
- import * as gtag from '../../../lib/gtag';
17
16
  const Box = ({ code, code_name, selected, selectedList, setSelectedList, activeTooltipId, setActiveTooltipId, tooltipTimeoutRef }) => {
18
17
  const [tooltipStyle, setTooltipStyle] = useState({});
19
18
  const buttonRef = useRef(null);
@@ -173,15 +172,15 @@ const StepOne = () => {
173
172
  { code: 'CT0029', code_name: '디지털포렌식' },
174
173
  { code: 'CT0030', code_name: '경호' }
175
174
  ];
176
- const signUpGAEvent = (userId) => {
177
- gtag.event({
178
- event_name: 'sign_up_ga_event',
179
- category: 'sign_up',
180
- label: `회원가입 완료 - ${userId}`,
181
- value: '1',
182
- user_id: userId
183
- });
184
- };
175
+ // const signUpGAEvent = (userId: string) => {
176
+ // gtag.event({
177
+ // event_name: 'sign_up_ga_event',
178
+ // category: 'sign_up',
179
+ // label: `회원가입 완료 - ${userId}`,
180
+ // value: '1',
181
+ // user_id: userId
182
+ // });
183
+ // };
185
184
  const appendUuidToRedirect = (redirect, uuid) => {
186
185
  if (!uuid)
187
186
  return redirect;
@@ -241,7 +240,7 @@ const StepOne = () => {
241
240
  user: userData
242
241
  };
243
242
  }),
244
- onSuccess: (data) => {
243
+ onSuccess: data => {
245
244
  var _a, _b;
246
245
  // console.log('data: ', data);
247
246
  const userIdx = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.idx;
@@ -253,7 +252,7 @@ const StepOne = () => {
253
252
  setIsModal(true);
254
253
  sessionStorage.removeItem('login');
255
254
  // ga trigger
256
- signUpGAEvent(String(userIdx !== null && userIdx !== void 0 ? userIdx : ''));
255
+ // signUpGAEvent(String(userIdx ?? ''));
257
256
  },
258
257
  onError: error => {
259
258
  console.error('Skip API 호출 실패:', error);
@@ -235,15 +235,15 @@ const StepOne = () => {
235
235
  { code: 'CT0030', code_name: '경호' }
236
236
  ];
237
237
 
238
- const signUpGAEvent = (userId: string) => {
239
- gtag.event({
240
- event_name: 'sign_up_ga_event',
241
- category: 'sign_up',
242
- label: `회원가입 완료 - ${userId}`,
243
- value: '1',
244
- user_id: userId
245
- });
246
- };
238
+ // const signUpGAEvent = (userId: string) => {
239
+ // gtag.event({
240
+ // event_name: 'sign_up_ga_event',
241
+ // category: 'sign_up',
242
+ // label: `회원가입 완료 - ${userId}`,
243
+ // value: '1',
244
+ // user_id: userId
245
+ // });
246
+ // };
247
247
 
248
248
  const appendUuidToRedirect = (redirect: string, uuid?: string) => {
249
249
  if (!uuid) return redirect;
@@ -252,10 +252,10 @@ const StepOne = () => {
252
252
  if (url.origin !== window.location.origin) return redirect; // 외부 도메인 차단
253
253
  url.searchParams.set('uuid', uuid);
254
254
  return url.pathname + url.search;
255
- } catch {
255
+ } catch {
256
256
  return redirect;
257
- }
258
- };
257
+ }
258
+ };
259
259
 
260
260
  const modalHandleClose = () => {
261
261
  setIsModal(false);
@@ -292,7 +292,7 @@ const StepOne = () => {
292
292
  })
293
293
  });
294
294
 
295
- // PATCH 성공 후 GET으로 상세 정보 조회
295
+ // PATCH 성공 후 GET으로 상세 정보 조회
296
296
  const userGetResponse = await fetch(`/api/lawfirm/app/user`, {
297
297
  method: 'GET',
298
298
  headers: { 'Content-Type': 'application/json' },
@@ -303,21 +303,21 @@ const StepOne = () => {
303
303
  throw new Error('사용자 정보 API 호출 실패');
304
304
  }
305
305
 
306
- const userData = await userGetResponse.json()
306
+ const userData = await userGetResponse.json();
307
307
 
308
308
  return {
309
309
  marketing: await marketingResponse.json(),
310
310
  user: userData
311
311
  };
312
312
  },
313
- onSuccess: (data) => {
313
+ onSuccess: data => {
314
314
  // console.log('data: ', data);
315
315
  const userIdx = data?.user?.data?.idx;
316
-
316
+
317
317
  const redirect = decodeURIComponent(getCookie('redirect')) || '/';
318
318
  const newRedirect = appendUuidToRedirect(redirect, String(userIdx ?? ''));
319
319
  // console.log('newRedirect:', newRedirect);
320
-
320
+
321
321
  setCookie({ key: 'redirect', value: newRedirect });
322
322
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
323
323
  setIsModal(true);
@@ -325,7 +325,7 @@ const StepOne = () => {
325
325
  sessionStorage.removeItem('login');
326
326
 
327
327
  // ga trigger
328
- signUpGAEvent(String(userIdx ?? ''));
328
+ // signUpGAEvent(String(userIdx ?? ''));
329
329
  },
330
330
  onError: error => {
331
331
  console.error('Skip API 호출 실패:', error);
@@ -14,7 +14,6 @@ import { useMutation } from '@tanstack/react-query';
14
14
  import { getCookie, setCookie } from '../../../lib';
15
15
  import ConfirmModal from './LoginComp/Modal/ConfirmModal';
16
16
  import Loader from '../../../components/Loader/Loader';
17
- import * as gtag from '../../../lib/gtag';
18
17
  const Box = ({ type_idx, tag_title, selected, selectedList, setSelectedList, activeTooltipId, setActiveTooltipId, tooltipTimeoutRef }) => {
19
18
  const [tooltipStyle, setTooltipStyle] = useState({});
20
19
  const buttonRef = useRef(null);
@@ -192,15 +191,15 @@ const StepTwo = () => {
192
191
  { code: 'CT0029', code_name: '디지털포렌식' },
193
192
  { code: 'CT0030', code_name: '경호' }
194
193
  ];
195
- const signUpGAEvent = (userId) => {
196
- gtag.event({
197
- event_name: 'sign_up_ga_event',
198
- category: 'sign_up',
199
- label: `회원가입 완료 - ${userId}`,
200
- value: '1',
201
- user_id: userId
202
- });
203
- };
194
+ // const signUpGAEvent = (userId: string) => {
195
+ // gtag.event({
196
+ // event_name: 'sign_up_ga_event',
197
+ // category: 'sign_up',
198
+ // label: `회원가입 완료 - ${userId}`,
199
+ // value: '1',
200
+ // user_id: userId
201
+ // });
202
+ // };
204
203
  // API 호출 함수
205
204
  const fetchFieldData = (centerCode) => __awaiter(void 0, void 0, void 0, function* () {
206
205
  try {
@@ -280,7 +279,7 @@ const StepTwo = () => {
280
279
  user: userData
281
280
  };
282
281
  }),
283
- onSuccess: (data) => {
282
+ onSuccess: data => {
284
283
  var _a, _b;
285
284
  // console.log('data: ', data);
286
285
  const userIdx = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.idx;
@@ -292,7 +291,7 @@ const StepTwo = () => {
292
291
  setIsModal(true);
293
292
  sessionStorage.removeItem('login');
294
293
  // ga trigger
295
- signUpGAEvent(String(userIdx !== null && userIdx !== void 0 ? userIdx : ''));
294
+ // signUpGAEvent(String(userIdx ?? ''));
296
295
  },
297
296
  onError: error => {
298
297
  console.error('Skip API 호출 실패:', error);
@@ -246,15 +246,15 @@ const StepTwo = () => {
246
246
  { code: 'CT0030', code_name: '경호' }
247
247
  ];
248
248
 
249
- const signUpGAEvent = (userId: string) => {
250
- gtag.event({
251
- event_name: 'sign_up_ga_event',
252
- category: 'sign_up',
253
- label: `회원가입 완료 - ${userId}`,
254
- value: '1',
255
- user_id: userId
256
- });
257
- };
249
+ // const signUpGAEvent = (userId: string) => {
250
+ // gtag.event({
251
+ // event_name: 'sign_up_ga_event',
252
+ // category: 'sign_up',
253
+ // label: `회원가입 완료 - ${userId}`,
254
+ // value: '1',
255
+ // user_id: userId
256
+ // });
257
+ // };
258
258
 
259
259
  // API 호출 함수
260
260
  const fetchFieldData = async (centerCode: string) => {
@@ -288,10 +288,10 @@ const StepTwo = () => {
288
288
  if (url.origin !== window.location.origin) return redirect; // 외부 도메인 차단
289
289
  url.searchParams.set('uuid', uuid);
290
290
  return url.pathname + url.search;
291
- } catch {
291
+ } catch {
292
292
  return redirect;
293
- }
294
- };
293
+ }
294
+ };
295
295
 
296
296
  const doneMutation = useMutation({
297
297
  mutationFn: async (bodyData: {
@@ -350,14 +350,14 @@ const StepTwo = () => {
350
350
  user: userData
351
351
  };
352
352
  },
353
- onSuccess: (data) => {
353
+ onSuccess: data => {
354
354
  // console.log('data: ', data);
355
355
  const userIdx = data?.user?.data?.idx;
356
-
356
+
357
357
  const redirect = decodeURIComponent(getCookie('redirect')) || '/';
358
358
  const newRedirect = appendUuidToRedirect(redirect, String(userIdx ?? ''));
359
359
  // console.log('newRedirect:', newRedirect);
360
-
360
+
361
361
  setCookie({ key: 'redirect', value: newRedirect });
362
362
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
363
363
  setIsModal(true);
@@ -365,9 +365,8 @@ const StepTwo = () => {
365
365
  sessionStorage.removeItem('login');
366
366
 
367
367
  // ga trigger
368
- signUpGAEvent(String(userIdx ?? ''));
368
+ // signUpGAEvent(String(userIdx ?? ''));
369
369
  },
370
-
371
370
 
372
371
  onError: error => {
373
372
  console.error('Skip API 호출 실패:', error);
@@ -147,7 +147,7 @@ const Withdraw = ({ layoutClassName = `py-[128px] max-lg:py-[112px] max-sm:py-[1
147
147
  <button type={'button'} onClick={() => __awaiter(void 0, void 0, void 0, function* () {
148
148
  yield completeWithdraw(reasons, etcReason);
149
149
  // uuid 쿠키 삭제
150
- document.cookie = '_dr_uuid=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
150
+ // document.cookie = '_dr_uuid=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
151
151
  })} className={` ${isAll ? ' bg-[#AE0E36] text-white ' : ' bg-[#EDEDED] text-[#909090] '} ` +
152
152
  ' title_small h-[72px] w-[740px] rounded-[36px] ' +
153
153
  ' max-lg:body_medium2 max-lg:h-[60px] max-lg:w-[620px] ' +
@@ -209,7 +209,7 @@ const Withdraw = ({ layoutClassName = `py-[128px] max-lg:py-[112px] max-sm:py-[1
209
209
  onClick={async () => {
210
210
  await completeWithdraw(reasons, etcReason);
211
211
  // uuid 쿠키 삭제
212
- document.cookie = '_dr_uuid=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
212
+ // document.cookie = '_dr_uuid=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
213
213
  }}
214
214
  className={
215
215
  ` ${isAll ? ' bg-[#AE0E36] text-white ' : ' bg-[#EDEDED] text-[#909090] '} ` +
@@ -7,7 +7,7 @@ import { getPowerLinkStr } from '../../../../lib';
7
7
  const SeoAdditionalLink = ({ type, linkList }) => {
8
8
  const referClick = () => {
9
9
  gtag.event({
10
- event_name: 'contents_refer',
10
+ action: 'contents_refer',
11
11
  category: 'contents',
12
12
  label: '컨텐츠 내 참고 컨텐츠 클릭',
13
13
  value: '1'
@@ -15,7 +15,7 @@ const SeoAdditionalLink = ({ type, linkList }) => {
15
15
  };
16
16
  const newsClick = () => {
17
17
  gtag.event({
18
- event_name: 'contents_news',
18
+ action: 'contents_news',
19
19
  category: 'contents',
20
20
  label: '컨텐츠 내 관련 기사 클릭',
21
21
  value: '1'
@@ -9,7 +9,7 @@ import { getPowerLinkStr } from '../../../../lib';
9
9
  const SeoAdditionalLink = ({ type, linkList }: { type: string; linkList: IAddLinkTypes[] }) => {
10
10
  const referClick = () => {
11
11
  gtag.event({
12
- event_name: 'contents_refer',
12
+ action: 'contents_refer',
13
13
  category: 'contents',
14
14
  label: '컨텐츠 내 참고 컨텐츠 클릭',
15
15
  value: '1'
@@ -18,7 +18,7 @@ const SeoAdditionalLink = ({ type, linkList }: { type: string; linkList: IAddLin
18
18
 
19
19
  const newsClick = () => {
20
20
  gtag.event({
21
- event_name: 'contents_news',
21
+ action: 'contents_news',
22
22
  category: 'contents',
23
23
  label: '컨텐츠 내 관련 기사 클릭',
24
24
  value: '1'
@@ -1,6 +1,8 @@
1
1
  export const GA_TRACKING_ID: "G-8ZNZYTEZQ5";
2
2
  export function page_view(screen_name: any): void;
3
- export function event({ event_name, ...params }: {
4
- [x: string]: any;
5
- event_name: any;
3
+ export function event({ action, category, label, value }: {
4
+ action: any;
5
+ category: any;
6
+ label: any;
7
+ value: any;
6
8
  }): void;
package/dist/lib/gtag.js CHANGED
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  export const GA_TRACKING_ID = 'G-8ZNZYTEZQ5';
13
2
  // https://developers.google.com/analytics/devguides/collection/ga4/events?hl=ko&client_type=gtag
14
3
  export const page_view = screen_name => {
@@ -22,25 +11,27 @@ export const page_view = screen_name => {
22
11
  console.warn('gtag is not defined');
23
12
  }
24
13
  };
25
- // export const event = ({ action, category, label, value }) => {
14
+ export const event = ({ action, category, label, value }) => {
15
+ if (typeof window !== 'undefined' && typeof window.gtag === 'function') {
16
+ window.gtag('event', action, {
17
+ app_name: process.env.NEXT_PUBLIC_SERVICE_DOMAIN || 'default_app',
18
+ event_name: label,
19
+ event_category: category,
20
+ value: value
21
+ });
22
+ }
23
+ else {
24
+ console.warn('gtag is not defined');
25
+ }
26
+ };
27
+ // 로그인/회원가입 ga 이벤트 적용할 때, 주석 해제하고 혜인님과 기훈님에게 event_name 변경된 것 내용 공유드려야함
28
+ // export const event = ({ event_name, ...params }) => { // 이름 변경 및 매개변수 이름 수정
26
29
  // if (typeof window !== 'undefined' && typeof window.gtag === 'function') {
27
- // window.gtag('event', action, {
30
+ // window.gtag('event', event_name, { // event_name 사용
28
31
  // app_name: process.env.NEXT_PUBLIC_SERVICE_DOMAIN || 'default_app',
29
- // event_name: label,
30
- // event_category: category,
31
- // value: value
32
+ // ...params // 커스텀 매개변수들을 바로 전달
32
33
  // });
33
34
  // } else {
34
35
  // console.warn('gtag is not defined');
35
36
  // }
36
37
  // };
37
- export const event = (_a) => {
38
- var { event_name } = _a, params = __rest(_a, ["event_name"]);
39
- if (typeof window !== 'undefined' && typeof window.gtag === 'function') {
40
- window.gtag('event', event_name, Object.assign({ app_name: process.env.NEXT_PUBLIC_SERVICE_DOMAIN || 'default_app' }, params // 커스텀 매개변수들을 바로 전달
41
- ));
42
- }
43
- else {
44
- console.warn('gtag is not defined');
45
- }
46
- };
@@ -1,8 +1,8 @@
1
1
  interface GtagClickProps {
2
- event_name: string;
2
+ action: string;
3
3
  category: string;
4
4
  label: string;
5
5
  }
6
- export declare const GtagClick: ({ event_name, category, label }: GtagClickProps) => void;
7
- export declare const handleGtagClick: (event_name: string, category: string, label: string) => void;
6
+ export declare const GtagClick: ({ action, category, label }: GtagClickProps) => void;
7
+ export declare const handleGtagClick: (action: string, category: string, label: string) => void;
8
8
  export {};
@@ -1,13 +1,13 @@
1
1
  import * as gtag from './gtag';
2
- export const GtagClick = ({ event_name, category, label }) => {
2
+ export const GtagClick = ({ action, category, label }) => {
3
3
  gtag.event({
4
- event_name: event_name,
4
+ action: action,
5
5
  category: category,
6
6
  label: label,
7
7
  value: '1'
8
8
  });
9
- console.log("I'm clicked", event_name);
9
+ console.log("I'm clicked", action);
10
10
  };
11
- export const handleGtagClick = (event_name, category, label) => {
12
- GtagClick({ event_name, category, label });
11
+ export const handleGtagClick = (action, category, label) => {
12
+ GtagClick({ action, category, label });
13
13
  };
@@ -1,21 +1,21 @@
1
1
  import * as gtag from './gtag';
2
2
 
3
3
  interface GtagClickProps {
4
- event_name: string;
4
+ action: string;
5
5
  category: string;
6
6
  label: string;
7
7
  }
8
8
 
9
- export const GtagClick = ({ event_name, category, label }: GtagClickProps) => {
9
+ export const GtagClick = ({ action, category, label }: GtagClickProps) => {
10
10
  gtag.event({
11
- event_name: event_name,
11
+ action: action,
12
12
  category: category,
13
13
  label: label,
14
14
  value: '1'
15
15
  });
16
- console.log("I'm clicked", event_name);
16
+ console.log("I'm clicked", action);
17
17
  };
18
18
 
19
- export const handleGtagClick = (event_name: string, category: string, label: string) => {
20
- GtagClick({ event_name, category, label });
19
+ export const handleGtagClick = (action: string, category: string, label: string) => {
20
+ GtagClick({ action, category, label });
21
21
  };