@adstage/web-sdk 3.0.13 → 3.0.14
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.
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.standalone.js +2 -2
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
- package/src/core/adstage.ts +5 -2
- package/src/modules/tracking/tracking-params.ts +19 -10
package/package.json
CHANGED
package/src/core/adstage.ts
CHANGED
|
@@ -109,8 +109,11 @@ export class AdStage {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
//
|
|
113
|
-
|
|
112
|
+
// 🎯 서버에 Attribution 자동 등록 (클릭 ID 또는 channel이 있는 경우, 단 URL로 이미 전달된 경우는 생략)
|
|
113
|
+
const hasClickId = TrackingParamsModule.hasClickId();
|
|
114
|
+
const hasChannel = !!(trackingParams && trackingParams.channel);
|
|
115
|
+
|
|
116
|
+
if (!aidFromUrl && trackingParams && (hasClickId || hasChannel)) {
|
|
114
117
|
// Attribution 등록을 Promise로 처리
|
|
115
118
|
const attributionPromise = (async () => {
|
|
116
119
|
try {
|
|
@@ -217,7 +217,7 @@ export class TrackingParamsModule {
|
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* Click 이벤트 자동 전송 여부 확인
|
|
220
|
-
* 새로운 클릭 ID
|
|
220
|
+
* 새로운 클릭 ID 또는 channel 파라미터가 발견되면 true 반환
|
|
221
221
|
*/
|
|
222
222
|
public static shouldSendClickEvent(): boolean {
|
|
223
223
|
if (typeof window === 'undefined') {
|
|
@@ -225,24 +225,33 @@ export class TrackingParamsModule {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
const params = TrackingParamsModule.get();
|
|
228
|
-
if (!params
|
|
228
|
+
if (!params) {
|
|
229
229
|
return false;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
//
|
|
233
|
-
const
|
|
234
|
-
|
|
232
|
+
// 클릭 ID 또는 channel 파라미터가 있어야 함
|
|
233
|
+
const hasClickId = TrackingParamsModule.hasClickId();
|
|
234
|
+
const hasChannel = !!params.channel;
|
|
235
235
|
|
|
236
|
-
if (!
|
|
236
|
+
if (!hasClickId && !hasChannel) {
|
|
237
237
|
return false;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
//
|
|
240
|
+
// 현재 식별자 추출 (clickId 우선, 없으면 channel+term 조합)
|
|
241
|
+
const currentIdentifier = hasClickId
|
|
242
|
+
? (params.gclid || params.fbclid || params.ttclid || params.nclid || params.liclid || params.msclkid || params.twclid)
|
|
243
|
+
: `${params.channel || ''}:${params.term || ''}`;
|
|
244
|
+
|
|
245
|
+
if (!currentIdentifier) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// 이미 처리된 식별자인지 확인 (중복 방지)
|
|
241
250
|
const lastClickId = sessionStorage.getItem('adstage_last_click_id');
|
|
242
251
|
|
|
243
|
-
// 새로운
|
|
244
|
-
if (
|
|
245
|
-
sessionStorage.setItem('adstage_last_click_id',
|
|
252
|
+
// 새로운 식별자면 전송 필요
|
|
253
|
+
if (currentIdentifier !== lastClickId) {
|
|
254
|
+
sessionStorage.setItem('adstage_last_click_id', currentIdentifier);
|
|
246
255
|
return true;
|
|
247
256
|
}
|
|
248
257
|
|