@adstage/web-sdk 2.5.0 → 2.5.1

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 CHANGED
@@ -499,7 +499,7 @@ class ApiHeaders {
499
499
  * AdStage SDK - 버전 정보 유틸리티
500
500
  */
501
501
  // package.json에서 버전 정보 가져오기 (빌드 시 자동으로 교체됨)
502
- const SDK_VERSION$1 = '"2.5.0"';
502
+ const SDK_VERSION$1 = '"2.5.1"';
503
503
  /**
504
504
  * SDK 버전 정보 반환
505
505
  */
@@ -1370,10 +1370,8 @@ class CarouselSliderManager {
1370
1370
  }
1371
1371
  });
1372
1372
  }
1373
- // 현재 슬라이드의 광고에 대해 노출 이벤트 추적
1374
- if (actualIndex > 0) { // 첫 번째는 이미 loadSlot에서 추적됨
1375
- trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
1376
- }
1373
+ // 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
1374
+ trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
1377
1375
  };
1378
1376
  // 무한 루프 처리 함수
1379
1377
  const handleInfiniteLoop = () => {
@@ -1415,8 +1413,12 @@ class CarouselSliderManager {
1415
1413
  if (dotContainer) {
1416
1414
  sliderWrapper.appendChild(dotContainer);
1417
1415
  }
1418
- // 첫 번째 도트 활성화
1416
+ // 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
1419
1417
  moveToSlide(0);
1418
+ // 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (500ms 후 실제 노출 확인)
1419
+ setTimeout(() => {
1420
+ trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
1421
+ }, 500);
1420
1422
  // 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
1421
1423
  if (!slot.width || slot.width === 0) {
1422
1424
  // DOM 렌더링 후 크기 측정
@@ -2599,11 +2601,9 @@ class AdsModule {
2599
2601
  // 광고가 여러 개이거나 autoSlide 옵션이 있으면 슬라이더로 렌더링
2600
2602
  if (adstageData.length > 1 || slot.config?.autoSlide) {
2601
2603
  await this.adRenderer?.renderAdSlider(slot, adstageData);
2602
- // 🔧 슬라이더의 번째 광고도 자동 노출 추적 시작
2603
- if (adstageData.length > 0) {
2604
- setTimeout(() => {
2605
- this.startSimpleViewabilityTracking(slot, adstageData[0]);
2606
- }, 100); // 슬라이더 렌더링 완료 후 추적 시작
2604
+ // 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
2605
+ if (this._config?.debug) {
2606
+ console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
2607
2607
  }
2608
2608
  }
2609
2609
  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.0"';
500
+ const SDK_VERSION$1 = '"2.5.1"';
501
501
  /**
502
502
  * SDK 버전 정보 반환
503
503
  */
@@ -1368,10 +1368,8 @@ class CarouselSliderManager {
1368
1368
  }
1369
1369
  });
1370
1370
  }
1371
- // 현재 슬라이드의 광고에 대해 노출 이벤트 추적
1372
- if (actualIndex > 0) { // 첫 번째는 이미 loadSlot에서 추적됨
1373
- trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
1374
- }
1371
+ // 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
1372
+ trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
1375
1373
  };
1376
1374
  // 무한 루프 처리 함수
1377
1375
  const handleInfiniteLoop = () => {
@@ -1413,8 +1411,12 @@ class CarouselSliderManager {
1413
1411
  if (dotContainer) {
1414
1412
  sliderWrapper.appendChild(dotContainer);
1415
1413
  }
1416
- // 첫 번째 도트 활성화
1414
+ // 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
1417
1415
  moveToSlide(0);
1416
+ // 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (500ms 후 실제 노출 확인)
1417
+ setTimeout(() => {
1418
+ trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
1419
+ }, 500);
1418
1420
  // 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
1419
1421
  if (!slot.width || slot.width === 0) {
1420
1422
  // DOM 렌더링 후 크기 측정
@@ -2597,11 +2599,9 @@ class AdsModule {
2597
2599
  // 광고가 여러 개이거나 autoSlide 옵션이 있으면 슬라이더로 렌더링
2598
2600
  if (adstageData.length > 1 || slot.config?.autoSlide) {
2599
2601
  await this.adRenderer?.renderAdSlider(slot, adstageData);
2600
- // 🔧 슬라이더의 번째 광고도 자동 노출 추적 시작
2601
- if (adstageData.length > 0) {
2602
- setTimeout(() => {
2603
- this.startSimpleViewabilityTracking(slot, adstageData[0]);
2604
- }, 100); // 슬라이더 렌더링 완료 후 추적 시작
2602
+ // 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
2603
+ if (this._config?.debug) {
2604
+ console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
2605
2605
  }
2606
2606
  }
2607
2607
  else {
@@ -494,7 +494,7 @@ class ApiHeaders {
494
494
  * AdStage SDK - 버전 정보 유틸리티
495
495
  */
496
496
  // package.json에서 버전 정보 가져오기 (빌드 시 자동으로 교체됨)
497
- const SDK_VERSION$1 = '"2.5.0"';
497
+ const SDK_VERSION$1 = '"2.5.1"';
498
498
  /**
499
499
  * SDK 버전 정보 반환
500
500
  */
@@ -1365,10 +1365,8 @@ class CarouselSliderManager {
1365
1365
  }
1366
1366
  });
1367
1367
  }
1368
- // 현재 슬라이드의 광고에 대해 노출 이벤트 추적
1369
- if (actualIndex > 0) { // 첫 번째는 이미 loadSlot에서 추적됨
1370
- trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
1371
- }
1368
+ // 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
1369
+ trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
1372
1370
  };
1373
1371
  // 무한 루프 처리 함수
1374
1372
  const handleInfiniteLoop = () => {
@@ -1410,8 +1408,12 @@ class CarouselSliderManager {
1410
1408
  if (dotContainer) {
1411
1409
  sliderWrapper.appendChild(dotContainer);
1412
1410
  }
1413
- // 첫 번째 도트 활성화
1411
+ // 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
1414
1412
  moveToSlide(0);
1413
+ // 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (500ms 후 실제 노출 확인)
1414
+ setTimeout(() => {
1415
+ trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
1416
+ }, 500);
1415
1417
  // 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
1416
1418
  if (!slot.width || slot.width === 0) {
1417
1419
  // DOM 렌더링 후 크기 측정
@@ -2594,11 +2596,9 @@ class AdsModule {
2594
2596
  // 광고가 여러 개이거나 autoSlide 옵션이 있으면 슬라이더로 렌더링
2595
2597
  if (adstageData.length > 1 || slot.config?.autoSlide) {
2596
2598
  await this.adRenderer?.renderAdSlider(slot, adstageData);
2597
- // 🔧 슬라이더의 번째 광고도 자동 노출 추적 시작
2598
- if (adstageData.length > 0) {
2599
- setTimeout(() => {
2600
- this.startSimpleViewabilityTracking(slot, adstageData[0]);
2601
- }, 100); // 슬라이더 렌더링 완료 후 추적 시작
2599
+ // 🔧 슬라이더는 CarouselSliderManager에서 자체적으로 모든 광고의 VIEWABLE 이벤트를 처리
2600
+ if (this._config?.debug) {
2601
+ console.log(`🎠 Slider will handle VIEWABLE events for ${adstageData.length} ads automatically`);
2602
2602
  }
2603
2603
  }
2604
2604
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adstage/web-sdk",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "AdStage Web SDK - Production-ready marketing platform SDK with React Provider support for seamless integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -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,8 @@ export class CarouselSliderManager {
217
217
  });
218
218
  }
219
219
 
220
- // 현재 슬라이드의 광고에 대해 노출 이벤트 추적
221
- if (actualIndex > 0) { // 첫 번째는 이미 loadSlot에서 추적됨
222
- trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
223
- }
220
+ // 현재 슬라이드의 광고에 대해 노출 이벤트 추적 (모든 슬라이드 포함)
221
+ trackEventCallback(advertisements[actualIndex]._id, slot.id, AdEventType.VIEWABLE);
224
222
  };
225
223
 
226
224
  // 무한 루프 처리 함수
@@ -270,8 +268,13 @@ export class CarouselSliderManager {
270
268
  sliderWrapper.appendChild(dotContainer);
271
269
  }
272
270
 
273
- // 첫 번째 도트 활성화
271
+ // 첫 번째 도트 활성화 및 초기 VIEWABLE 이벤트 발생
274
272
  moveToSlide(0);
273
+
274
+ // 슬라이더 DOM 추가 후 첫 번째 광고 VIEWABLE 이벤트 트리거 (500ms 후 실제 노출 확인)
275
+ setTimeout(() => {
276
+ trackEventCallback(advertisements[0]._id, slot.id, AdEventType.VIEWABLE);
277
+ }, 500);
275
278
 
276
279
  // 사용자가 크기를 지정하지 않은 경우, 첫 번째 슬라이드 크기에 맞춰 래퍼 크기 동적 조정
277
280
  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 (adstageData.length > 0) {
303
- setTimeout(() => {
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개면 일반 렌더링