@adstage/web-sdk 2.5.0 → 2.5.2
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 +13 -11
- package/dist/index.esm.js +13 -11
- package/dist/index.standalone.js +13 -11
- package/package.json +1 -1
- package/src/dummy/ads_dummy.json +84 -0
- package/src/managers/ads/carousel-slider-manager.ts +10 -5
- package/src/modules/ads/AdsModule.ts +3 -5
package/dist/index.cjs.js
CHANGED
|
@@ -499,7 +499,7 @@ class ApiHeaders {
|
|
|
499
499
|
* AdStage SDK - 버전 정보 유틸리티
|
|
500
500
|
*/
|
|
501
501
|
// package.json에서 버전 정보 가져오기 (빌드 시 자동으로 교체됨)
|
|
502
|
-
const SDK_VERSION$1 = '"2.5.
|
|
502
|
+
const SDK_VERSION$1 = '"2.5.2"';
|
|
503
503
|
/**
|
|
504
504
|
* SDK 버전 정보 반환
|
|
505
505
|
*/
|
|
@@ -1370,10 +1370,9 @@ class CarouselSliderManager {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
});
|
|
1372
1372
|
}
|
|
1373
|
-
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
}
|
|
1373
|
+
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
|
|
1374
|
+
console.log(`🎯 Triggering VIEWABLE event for slide change: ad ${advertisements[actualIndex]._id} (index: ${actualIndex}) in slot: ${slot.id}`);
|
|
1375
|
+
trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
|
|
1377
1376
|
};
|
|
1378
1377
|
// 무한 루프 처리 함수
|
|
1379
1378
|
const handleInfiniteLoop = () => {
|
|
@@ -1415,8 +1414,13 @@ class CarouselSliderManager {
|
|
|
1415
1414
|
if (dotContainer) {
|
|
1416
1415
|
sliderWrapper.appendChild(dotContainer);
|
|
1417
1416
|
}
|
|
1418
|
-
// 첫 번째 도트 활성화
|
|
1417
|
+
// 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
|
|
1419
1418
|
moveToSlide(0);
|
|
1419
|
+
// 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (100ms 후 실제 노출 확인)
|
|
1420
|
+
setTimeout(() => {
|
|
1421
|
+
console.log(`🎯 Triggering initial VIEWABLE event for first ad: ${advertisements[0]._id} in slot: ${slot.id}`);
|
|
1422
|
+
trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
|
|
1423
|
+
}, 100);
|
|
1420
1424
|
// 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
|
|
1421
1425
|
if (!slot.width || slot.width === 0) {
|
|
1422
1426
|
// DOM 렌더링 후 크기 측정
|
|
@@ -2599,11 +2603,9 @@ class AdsModule {
|
|
|
2599
2603
|
// 광고가 여러 개이거나 autoSlide 옵션이 있으면 슬라이더로 렌더링
|
|
2600
2604
|
if (adstageData.length > 1 || slot.config?.autoSlide) {
|
|
2601
2605
|
await this.adRenderer?.renderAdSlider(slot, adstageData);
|
|
2602
|
-
// 🔧
|
|
2603
|
-
if (
|
|
2604
|
-
|
|
2605
|
-
this.startSimpleViewabilityTracking(slot, adstageData[0]);
|
|
2606
|
-
}, 100); // 슬라이더 렌더링 완료 후 추적 시작
|
|
2606
|
+
// 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
|
|
2607
|
+
if (this._config?.debug) {
|
|
2608
|
+
console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
|
|
2607
2609
|
}
|
|
2608
2610
|
}
|
|
2609
2611
|
else {
|
package/dist/index.esm.js
CHANGED
|
@@ -497,7 +497,7 @@ class ApiHeaders {
|
|
|
497
497
|
* AdStage SDK - 버전 정보 유틸리티
|
|
498
498
|
*/
|
|
499
499
|
// package.json에서 버전 정보 가져오기 (빌드 시 자동으로 교체됨)
|
|
500
|
-
const SDK_VERSION$1 = '"2.5.
|
|
500
|
+
const SDK_VERSION$1 = '"2.5.2"';
|
|
501
501
|
/**
|
|
502
502
|
* SDK 버전 정보 반환
|
|
503
503
|
*/
|
|
@@ -1368,10 +1368,9 @@ class CarouselSliderManager {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
});
|
|
1370
1370
|
}
|
|
1371
|
-
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
}
|
|
1371
|
+
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
|
|
1372
|
+
console.log(`🎯 Triggering VIEWABLE event for slide change: ad ${advertisements[actualIndex]._id} (index: ${actualIndex}) in slot: ${slot.id}`);
|
|
1373
|
+
trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
|
|
1375
1374
|
};
|
|
1376
1375
|
// 무한 루프 처리 함수
|
|
1377
1376
|
const handleInfiniteLoop = () => {
|
|
@@ -1413,8 +1412,13 @@ class CarouselSliderManager {
|
|
|
1413
1412
|
if (dotContainer) {
|
|
1414
1413
|
sliderWrapper.appendChild(dotContainer);
|
|
1415
1414
|
}
|
|
1416
|
-
// 첫 번째 도트 활성화
|
|
1415
|
+
// 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
|
|
1417
1416
|
moveToSlide(0);
|
|
1417
|
+
// 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (100ms 후 실제 노출 확인)
|
|
1418
|
+
setTimeout(() => {
|
|
1419
|
+
console.log(`🎯 Triggering initial VIEWABLE event for first ad: ${advertisements[0]._id} in slot: ${slot.id}`);
|
|
1420
|
+
trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
|
|
1421
|
+
}, 100);
|
|
1418
1422
|
// 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
|
|
1419
1423
|
if (!slot.width || slot.width === 0) {
|
|
1420
1424
|
// DOM 렌더링 후 크기 측정
|
|
@@ -2597,11 +2601,9 @@ class AdsModule {
|
|
|
2597
2601
|
// 광고가 여러 개이거나 autoSlide 옵션이 있으면 슬라이더로 렌더링
|
|
2598
2602
|
if (adstageData.length > 1 || slot.config?.autoSlide) {
|
|
2599
2603
|
await this.adRenderer?.renderAdSlider(slot, adstageData);
|
|
2600
|
-
// 🔧
|
|
2601
|
-
if (
|
|
2602
|
-
|
|
2603
|
-
this.startSimpleViewabilityTracking(slot, adstageData[0]);
|
|
2604
|
-
}, 100); // 슬라이더 렌더링 완료 후 추적 시작
|
|
2604
|
+
// 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
|
|
2605
|
+
if (this._config?.debug) {
|
|
2606
|
+
console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
|
|
2605
2607
|
}
|
|
2606
2608
|
}
|
|
2607
2609
|
else {
|
package/dist/index.standalone.js
CHANGED
|
@@ -494,7 +494,7 @@ class ApiHeaders {
|
|
|
494
494
|
* AdStage SDK - 버전 정보 유틸리티
|
|
495
495
|
*/
|
|
496
496
|
// package.json에서 버전 정보 가져오기 (빌드 시 자동으로 교체됨)
|
|
497
|
-
const SDK_VERSION$1 = '"2.5.
|
|
497
|
+
const SDK_VERSION$1 = '"2.5.2"';
|
|
498
498
|
/**
|
|
499
499
|
* SDK 버전 정보 반환
|
|
500
500
|
*/
|
|
@@ -1365,10 +1365,9 @@ class CarouselSliderManager {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
});
|
|
1367
1367
|
}
|
|
1368
|
-
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
}
|
|
1368
|
+
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
|
|
1369
|
+
console.log(`🎯 Triggering VIEWABLE event for slide change: ad ${advertisements[actualIndex]._id} (index: ${actualIndex}) in slot: ${slot.id}`);
|
|
1370
|
+
trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
|
|
1372
1371
|
};
|
|
1373
1372
|
// 무한 루프 처리 함수
|
|
1374
1373
|
const handleInfiniteLoop = () => {
|
|
@@ -1410,8 +1409,13 @@ class CarouselSliderManager {
|
|
|
1410
1409
|
if (dotContainer) {
|
|
1411
1410
|
sliderWrapper.appendChild(dotContainer);
|
|
1412
1411
|
}
|
|
1413
|
-
// 첫 번째 도트 활성화
|
|
1412
|
+
// 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
|
|
1414
1413
|
moveToSlide(0);
|
|
1414
|
+
// 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (100ms 후 실제 노출 확인)
|
|
1415
|
+
setTimeout(() => {
|
|
1416
|
+
console.log(`🎯 Triggering initial VIEWABLE event for first ad: ${advertisements[0]._id} in slot: ${slot.id}`);
|
|
1417
|
+
trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
|
|
1418
|
+
}, 100);
|
|
1415
1419
|
// 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
|
|
1416
1420
|
if (!slot.width || slot.width === 0) {
|
|
1417
1421
|
// DOM 렌더링 후 크기 측정
|
|
@@ -2594,11 +2598,9 @@ class AdsModule {
|
|
|
2594
2598
|
// 광고가 여러 개이거나 autoSlide 옵션이 있으면 슬라이더로 렌더링
|
|
2595
2599
|
if (adstageData.length > 1 || slot.config?.autoSlide) {
|
|
2596
2600
|
await this.adRenderer?.renderAdSlider(slot, adstageData);
|
|
2597
|
-
// 🔧
|
|
2598
|
-
if (
|
|
2599
|
-
|
|
2600
|
-
this.startSimpleViewabilityTracking(slot, adstageData[0]);
|
|
2601
|
-
}, 100); // 슬라이더 렌더링 완료 후 추적 시작
|
|
2601
|
+
// 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
|
|
2602
|
+
if (this._config?.debug) {
|
|
2603
|
+
console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
|
|
2602
2604
|
}
|
|
2603
2605
|
}
|
|
2604
2606
|
else {
|
package/package.json
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"_id": "68870e36bdfa1e6e54d108a5",
|
|
4
|
+
"title": "stageUp 입점 신청 - 수수료 할인 광고",
|
|
5
|
+
"description": "",
|
|
6
|
+
"adType": "BANNER",
|
|
7
|
+
"orgId": "c1cd5bb0-2f45-4e49-8e86-7ba653d3477c",
|
|
8
|
+
"textContent": "",
|
|
9
|
+
"imageUrl": "https://cmvn255e11092.edge.naverncp.com/d82ceba0-ce99-48e0-9a19-6a6c8792af31.png",
|
|
10
|
+
"videoUrl": "",
|
|
11
|
+
"linkUrl": "/partnership",
|
|
12
|
+
"startDate": "2025-07-28T00:00:00.000Z",
|
|
13
|
+
"endDate": "2025-12-31T00:00:00.000Z",
|
|
14
|
+
"status": "ACTIVE",
|
|
15
|
+
"order": 0,
|
|
16
|
+
"language": "ko",
|
|
17
|
+
"countries": [
|
|
18
|
+
"KR",
|
|
19
|
+
"US",
|
|
20
|
+
"JP",
|
|
21
|
+
"CN",
|
|
22
|
+
"DE",
|
|
23
|
+
"FR",
|
|
24
|
+
"GB",
|
|
25
|
+
"IT",
|
|
26
|
+
"ES",
|
|
27
|
+
"RU",
|
|
28
|
+
"ID",
|
|
29
|
+
"VN",
|
|
30
|
+
"TH",
|
|
31
|
+
"MY",
|
|
32
|
+
"SG",
|
|
33
|
+
"PH",
|
|
34
|
+
"IN",
|
|
35
|
+
"BR",
|
|
36
|
+
"CA",
|
|
37
|
+
"AU"
|
|
38
|
+
],
|
|
39
|
+
"deviceType": "DESKTOP",
|
|
40
|
+
"createdAt": "2025-07-28T05:44:22.999Z",
|
|
41
|
+
"updatedAt": "2025-07-28T05:45:12.589Z"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"_id": "68870edbbdfa1e6e54d10901",
|
|
45
|
+
"title": "Join stageUp Today! - 간편한 통합 절차",
|
|
46
|
+
"description": "",
|
|
47
|
+
"adType": "BANNER",
|
|
48
|
+
"orgId": "c1cd5bb0-2f45-4e49-8e86-7ba653d3477c",
|
|
49
|
+
"textContent": "",
|
|
50
|
+
"imageUrl": "https://cmvn255e11092.edge.naverncp.com/550849fd-9c25-4e15-bd0f-a3efd7cff617.webp",
|
|
51
|
+
"videoUrl": "",
|
|
52
|
+
"linkUrl": "https://www.stageup.store/",
|
|
53
|
+
"startDate": "2025-07-28T00:00:00.000Z",
|
|
54
|
+
"endDate": "2025-12-31T00:00:00.000Z",
|
|
55
|
+
"status": "ACTIVE",
|
|
56
|
+
"order": 1,
|
|
57
|
+
"language": "ko",
|
|
58
|
+
"countries": [
|
|
59
|
+
"KR",
|
|
60
|
+
"US",
|
|
61
|
+
"JP",
|
|
62
|
+
"CN",
|
|
63
|
+
"DE",
|
|
64
|
+
"FR",
|
|
65
|
+
"GB",
|
|
66
|
+
"IT",
|
|
67
|
+
"ES",
|
|
68
|
+
"RU",
|
|
69
|
+
"ID",
|
|
70
|
+
"VN",
|
|
71
|
+
"TH",
|
|
72
|
+
"MY",
|
|
73
|
+
"SG",
|
|
74
|
+
"PH",
|
|
75
|
+
"IN",
|
|
76
|
+
"BR",
|
|
77
|
+
"CA",
|
|
78
|
+
"AU"
|
|
79
|
+
],
|
|
80
|
+
"deviceType": "DESKTOP",
|
|
81
|
+
"createdAt": "2025-07-28T05:47:07.685Z",
|
|
82
|
+
"updatedAt": "2025-07-28T05:47:07.685Z"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
@@ -217,10 +217,9 @@ export class CarouselSliderManager {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
220
|
+
// 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
|
|
221
|
+
console.log(`🎯 Triggering VIEWABLE event for slide change: ad ${advertisements[actualIndex]._id} (index: ${actualIndex}) in slot: ${slot.id}`);
|
|
222
|
+
trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
|
|
224
223
|
};
|
|
225
224
|
|
|
226
225
|
// 무한 루프 처리 함수
|
|
@@ -270,8 +269,14 @@ export class CarouselSliderManager {
|
|
|
270
269
|
sliderWrapper.appendChild(dotContainer);
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
// 첫 번째 도트 활성화
|
|
272
|
+
// 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
|
|
274
273
|
moveToSlide(0);
|
|
274
|
+
|
|
275
|
+
// 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (100ms 후 실제 노출 확인)
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
console.log(`🎯 Triggering initial VIEWABLE event for first ad: ${advertisements[0]._id} in slot: ${slot.id}`);
|
|
278
|
+
trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
|
|
279
|
+
}, 100);
|
|
275
280
|
|
|
276
281
|
// 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
|
|
277
282
|
if (!slot.width || slot.width === 0) {
|
|
@@ -298,11 +298,9 @@ export class AdsModule implements BaseModule {
|
|
|
298
298
|
if (adstageData.length > 1 || (slot.config as any)?.autoSlide) {
|
|
299
299
|
await this.adRenderer?.renderAdSlider(slot, adstageData);
|
|
300
300
|
|
|
301
|
-
// 🔧
|
|
302
|
-
if (
|
|
303
|
-
|
|
304
|
-
this.startSimpleViewabilityTracking(slot, adstageData[0]);
|
|
305
|
-
}, 100); // 슬라이더 렌더링 완료 후 추적 시작
|
|
301
|
+
// 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
|
|
302
|
+
if (this._config?.debug) {
|
|
303
|
+
console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
|
|
306
304
|
}
|
|
307
305
|
} else {
|
|
308
306
|
// 광고가 1개면 일반 렌더링
|