@adstage/web-sdk 1.3.2 β†’ 1.3.3

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
@@ -1852,29 +1852,53 @@ class AdStageSDK {
1852
1852
  ...(options?.deviceType && { deviceType: options.deviceType }),
1853
1853
  ...(options?.country && { country: options.country }),
1854
1854
  });
1855
- const response = await fetch(`${this.baseUrl}/advertisements/list?${queryParams}`, {
1855
+ const requestUrl = `${this.baseUrl}/advertisements/list?${queryParams}`;
1856
+ if (this.config.debug) {
1857
+ console.log(`🌐 κ΄‘κ³  API μš”μ²­ μ‹œμž‘:`, {
1858
+ url: requestUrl,
1859
+ apiKey: this.config.apiKey.substring(0, 10) + '...',
1860
+ slot: slot.id
1861
+ });
1862
+ }
1863
+ const response = await fetch(requestUrl, {
1856
1864
  headers: {
1857
1865
  'x-api-key': this.config.apiKey,
1858
1866
  'Content-Type': 'application/json',
1859
1867
  },
1860
1868
  });
1869
+ if (this.config.debug) {
1870
+ console.log(`πŸ“‘ API 응닡 μƒνƒœ:`, {
1871
+ status: response.status,
1872
+ statusText: response.statusText,
1873
+ ok: response.ok
1874
+ });
1875
+ }
1861
1876
  if (!response.ok) {
1862
1877
  throw new Error(`HTTP error! status: ${response.status}`);
1863
1878
  }
1864
1879
  const data = await response.json();
1880
+ if (this.config.debug) {
1881
+ console.log(`πŸ“Š API 응닡 데이터:`, {
1882
+ data,
1883
+ advertisementsCount: data.advertisements ? data.advertisements.length : 0
1884
+ });
1885
+ }
1865
1886
  const advertisements = data.advertisements || [];
1866
1887
  if (advertisements.length > 0) {
1888
+ if (this.config.debug) {
1889
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³  발견:`, advertisements);
1890
+ }
1867
1891
  // μ—¬λŸ¬ κ΄‘κ³ κ°€ μžˆμ„ 경우 μŠ¬λΌμ΄λ“œλ‘œ λ Œλ”λ§
1868
1892
  this.renderSlotWithSlider(slot, advertisements, options);
1869
1893
  // 첫 번째 광고에 λŒ€ν•΄μ„œλ§Œ λ…ΈμΆœ 이벀트 좔적
1870
1894
  await this.eventTracker.trackEvent(advertisements[0]._id, slot.id, exports.AdEventType.IMPRESSION);
1871
1895
  }
1872
1896
  else {
1873
- console.warn(`No advertisements available for slot ${slot.id}`);
1897
+ console.warn(`⚠️ 슬둯 ${slot.id}에 μ‚¬μš© κ°€λŠ₯ν•œ κ΄‘κ³ κ°€ μ—†μŠ΅λ‹ˆλ‹€. API 응닡:`, data);
1874
1898
  }
1875
1899
  }
1876
1900
  catch (error) {
1877
- console.error(`Failed to load slot ${slot.id}:`, error);
1901
+ console.error(`❌ 슬둯 ${slot.id} λ‘œλ“œ μ‹€νŒ¨:`, error);
1878
1902
  }
1879
1903
  }
1880
1904
  /**
@@ -1882,8 +1906,18 @@ class AdStageSDK {
1882
1906
  */
1883
1907
  renderSlotWithSlider(slot, advertisements, options) {
1884
1908
  const container = DOMUtils.safeGetElementById(slot.containerId);
1885
- if (!container)
1909
+ if (!container) {
1910
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
1886
1911
  return;
1912
+ }
1913
+ if (this.config.debug) {
1914
+ console.log(`🎨 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
1915
+ slotId: slot.id,
1916
+ containerId: slot.containerId,
1917
+ advertisementCount: advertisements.length,
1918
+ container: container
1919
+ });
1920
+ }
1887
1921
  if (advertisements.length === 1) {
1888
1922
  // κ΄‘κ³ κ°€ ν•˜λ‚˜λΏμ΄λ©΄ κΈ°λ³Έ λ Œλ”λ§
1889
1923
  this.renderSlot(slot, advertisements[0]);
@@ -1907,7 +1941,11 @@ class AdStageSDK {
1907
1941
  slot.isLoaded = true;
1908
1942
  if (this.config.debug) {
1909
1943
  const sliderType = useFadeEffect ? 'fade slider' : 'slider';
1910
- console.log(`Rendered ${advertisements.length} ads with ${sliderType} for slot ${slot.id}:`, advertisements);
1944
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³ λ₯Ό ${sliderType}둜 λ Œλ”λ§ μ™„λ£Œ:`, {
1945
+ slotId: slot.id,
1946
+ container: container,
1947
+ sliderContainer: sliderContainer
1948
+ });
1911
1949
  }
1912
1950
  }
1913
1951
  /**
@@ -1915,15 +1953,36 @@ class AdStageSDK {
1915
1953
  */
1916
1954
  renderSlot(slot, ad) {
1917
1955
  const container = DOMUtils.safeGetElementById(slot.containerId);
1918
- if (!container)
1956
+ if (!container) {
1957
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
1919
1958
  return;
1959
+ }
1960
+ if (this.config.debug) {
1961
+ console.log(`🎨 단일 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
1962
+ slotId: slot.id,
1963
+ containerId: slot.containerId,
1964
+ ad: ad,
1965
+ container: container
1966
+ });
1967
+ }
1920
1968
  // νŒ©ν† λ¦¬λ₯Ό μ‚¬μš©ν•΄μ„œ μ μ ˆν•œ λ Œλ”λŸ¬λ‘œ κ΄‘κ³  생성
1921
1969
  const adElement = AdRendererFactory.render(ad, slot, (adId, slotId, eventType) => this.eventTracker.trackEvent(adId, slotId, eventType));
1970
+ if (this.config.debug) {
1971
+ console.log(`πŸ”§ κ΄‘κ³  μš”μ†Œ 생성됨:`, {
1972
+ adElement: adElement,
1973
+ tagName: adElement.tagName,
1974
+ innerHTML: adElement.innerHTML.substring(0, 200) + '...'
1975
+ });
1976
+ }
1922
1977
  container.innerHTML = '';
1923
1978
  container.appendChild(adElement);
1924
1979
  slot.isLoaded = true;
1925
1980
  if (this.config.debug) {
1926
- console.log(`Rendered ad for slot ${slot.id}:`, ad);
1981
+ console.log(`βœ… 단일 κ΄‘κ³  λ Œλ”λ§ μ™„λ£Œ:`, {
1982
+ slotId: slot.id,
1983
+ ad: ad,
1984
+ containerContent: container.innerHTML.substring(0, 200) + '...'
1985
+ });
1927
1986
  }
1928
1987
  }
1929
1988
  /**
package/dist/index.esm.js CHANGED
@@ -1848,29 +1848,53 @@ class AdStageSDK {
1848
1848
  ...(options?.deviceType && { deviceType: options.deviceType }),
1849
1849
  ...(options?.country && { country: options.country }),
1850
1850
  });
1851
- const response = await fetch(`${this.baseUrl}/advertisements/list?${queryParams}`, {
1851
+ const requestUrl = `${this.baseUrl}/advertisements/list?${queryParams}`;
1852
+ if (this.config.debug) {
1853
+ console.log(`🌐 κ΄‘κ³  API μš”μ²­ μ‹œμž‘:`, {
1854
+ url: requestUrl,
1855
+ apiKey: this.config.apiKey.substring(0, 10) + '...',
1856
+ slot: slot.id
1857
+ });
1858
+ }
1859
+ const response = await fetch(requestUrl, {
1852
1860
  headers: {
1853
1861
  'x-api-key': this.config.apiKey,
1854
1862
  'Content-Type': 'application/json',
1855
1863
  },
1856
1864
  });
1865
+ if (this.config.debug) {
1866
+ console.log(`πŸ“‘ API 응닡 μƒνƒœ:`, {
1867
+ status: response.status,
1868
+ statusText: response.statusText,
1869
+ ok: response.ok
1870
+ });
1871
+ }
1857
1872
  if (!response.ok) {
1858
1873
  throw new Error(`HTTP error! status: ${response.status}`);
1859
1874
  }
1860
1875
  const data = await response.json();
1876
+ if (this.config.debug) {
1877
+ console.log(`πŸ“Š API 응닡 데이터:`, {
1878
+ data,
1879
+ advertisementsCount: data.advertisements ? data.advertisements.length : 0
1880
+ });
1881
+ }
1861
1882
  const advertisements = data.advertisements || [];
1862
1883
  if (advertisements.length > 0) {
1884
+ if (this.config.debug) {
1885
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³  발견:`, advertisements);
1886
+ }
1863
1887
  // μ—¬λŸ¬ κ΄‘κ³ κ°€ μžˆμ„ 경우 μŠ¬λΌμ΄λ“œλ‘œ λ Œλ”λ§
1864
1888
  this.renderSlotWithSlider(slot, advertisements, options);
1865
1889
  // 첫 번째 광고에 λŒ€ν•΄μ„œλ§Œ λ…ΈμΆœ 이벀트 좔적
1866
1890
  await this.eventTracker.trackEvent(advertisements[0]._id, slot.id, AdEventType.IMPRESSION);
1867
1891
  }
1868
1892
  else {
1869
- console.warn(`No advertisements available for slot ${slot.id}`);
1893
+ console.warn(`⚠️ 슬둯 ${slot.id}에 μ‚¬μš© κ°€λŠ₯ν•œ κ΄‘κ³ κ°€ μ—†μŠ΅λ‹ˆλ‹€. API 응닡:`, data);
1870
1894
  }
1871
1895
  }
1872
1896
  catch (error) {
1873
- console.error(`Failed to load slot ${slot.id}:`, error);
1897
+ console.error(`❌ 슬둯 ${slot.id} λ‘œλ“œ μ‹€νŒ¨:`, error);
1874
1898
  }
1875
1899
  }
1876
1900
  /**
@@ -1878,8 +1902,18 @@ class AdStageSDK {
1878
1902
  */
1879
1903
  renderSlotWithSlider(slot, advertisements, options) {
1880
1904
  const container = DOMUtils.safeGetElementById(slot.containerId);
1881
- if (!container)
1905
+ if (!container) {
1906
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
1882
1907
  return;
1908
+ }
1909
+ if (this.config.debug) {
1910
+ console.log(`🎨 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
1911
+ slotId: slot.id,
1912
+ containerId: slot.containerId,
1913
+ advertisementCount: advertisements.length,
1914
+ container: container
1915
+ });
1916
+ }
1883
1917
  if (advertisements.length === 1) {
1884
1918
  // κ΄‘κ³ κ°€ ν•˜λ‚˜λΏμ΄λ©΄ κΈ°λ³Έ λ Œλ”λ§
1885
1919
  this.renderSlot(slot, advertisements[0]);
@@ -1903,7 +1937,11 @@ class AdStageSDK {
1903
1937
  slot.isLoaded = true;
1904
1938
  if (this.config.debug) {
1905
1939
  const sliderType = useFadeEffect ? 'fade slider' : 'slider';
1906
- console.log(`Rendered ${advertisements.length} ads with ${sliderType} for slot ${slot.id}:`, advertisements);
1940
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³ λ₯Ό ${sliderType}둜 λ Œλ”λ§ μ™„λ£Œ:`, {
1941
+ slotId: slot.id,
1942
+ container: container,
1943
+ sliderContainer: sliderContainer
1944
+ });
1907
1945
  }
1908
1946
  }
1909
1947
  /**
@@ -1911,15 +1949,36 @@ class AdStageSDK {
1911
1949
  */
1912
1950
  renderSlot(slot, ad) {
1913
1951
  const container = DOMUtils.safeGetElementById(slot.containerId);
1914
- if (!container)
1952
+ if (!container) {
1953
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
1915
1954
  return;
1955
+ }
1956
+ if (this.config.debug) {
1957
+ console.log(`🎨 단일 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
1958
+ slotId: slot.id,
1959
+ containerId: slot.containerId,
1960
+ ad: ad,
1961
+ container: container
1962
+ });
1963
+ }
1916
1964
  // νŒ©ν† λ¦¬λ₯Ό μ‚¬μš©ν•΄μ„œ μ μ ˆν•œ λ Œλ”λŸ¬λ‘œ κ΄‘κ³  생성
1917
1965
  const adElement = AdRendererFactory.render(ad, slot, (adId, slotId, eventType) => this.eventTracker.trackEvent(adId, slotId, eventType));
1966
+ if (this.config.debug) {
1967
+ console.log(`πŸ”§ κ΄‘κ³  μš”μ†Œ 생성됨:`, {
1968
+ adElement: adElement,
1969
+ tagName: adElement.tagName,
1970
+ innerHTML: adElement.innerHTML.substring(0, 200) + '...'
1971
+ });
1972
+ }
1918
1973
  container.innerHTML = '';
1919
1974
  container.appendChild(adElement);
1920
1975
  slot.isLoaded = true;
1921
1976
  if (this.config.debug) {
1922
- console.log(`Rendered ad for slot ${slot.id}:`, ad);
1977
+ console.log(`βœ… 단일 κ΄‘κ³  λ Œλ”λ§ μ™„λ£Œ:`, {
1978
+ slotId: slot.id,
1979
+ ad: ad,
1980
+ containerContent: container.innerHTML.substring(0, 200) + '...'
1981
+ });
1923
1982
  }
1924
1983
  }
1925
1984
  /**
@@ -1848,29 +1848,53 @@ class AdStageSDK {
1848
1848
  ...(options?.deviceType && { deviceType: options.deviceType }),
1849
1849
  ...(options?.country && { country: options.country }),
1850
1850
  });
1851
- const response = await fetch(`${this.baseUrl}/advertisements/list?${queryParams}`, {
1851
+ const requestUrl = `${this.baseUrl}/advertisements/list?${queryParams}`;
1852
+ if (this.config.debug) {
1853
+ console.log(`🌐 κ΄‘κ³  API μš”μ²­ μ‹œμž‘:`, {
1854
+ url: requestUrl,
1855
+ apiKey: this.config.apiKey.substring(0, 10) + '...',
1856
+ slot: slot.id
1857
+ });
1858
+ }
1859
+ const response = await fetch(requestUrl, {
1852
1860
  headers: {
1853
1861
  'x-api-key': this.config.apiKey,
1854
1862
  'Content-Type': 'application/json',
1855
1863
  },
1856
1864
  });
1865
+ if (this.config.debug) {
1866
+ console.log(`πŸ“‘ API 응닡 μƒνƒœ:`, {
1867
+ status: response.status,
1868
+ statusText: response.statusText,
1869
+ ok: response.ok
1870
+ });
1871
+ }
1857
1872
  if (!response.ok) {
1858
1873
  throw new Error(`HTTP error! status: ${response.status}`);
1859
1874
  }
1860
1875
  const data = await response.json();
1876
+ if (this.config.debug) {
1877
+ console.log(`πŸ“Š API 응닡 데이터:`, {
1878
+ data,
1879
+ advertisementsCount: data.advertisements ? data.advertisements.length : 0
1880
+ });
1881
+ }
1861
1882
  const advertisements = data.advertisements || [];
1862
1883
  if (advertisements.length > 0) {
1884
+ if (this.config.debug) {
1885
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³  발견:`, advertisements);
1886
+ }
1863
1887
  // μ—¬λŸ¬ κ΄‘κ³ κ°€ μžˆμ„ 경우 μŠ¬λΌμ΄λ“œλ‘œ λ Œλ”λ§
1864
1888
  this.renderSlotWithSlider(slot, advertisements, options);
1865
1889
  // 첫 번째 광고에 λŒ€ν•΄μ„œλ§Œ λ…ΈμΆœ 이벀트 좔적
1866
1890
  await this.eventTracker.trackEvent(advertisements[0]._id, slot.id, AdEventType.IMPRESSION);
1867
1891
  }
1868
1892
  else {
1869
- console.warn(`No advertisements available for slot ${slot.id}`);
1893
+ console.warn(`⚠️ 슬둯 ${slot.id}에 μ‚¬μš© κ°€λŠ₯ν•œ κ΄‘κ³ κ°€ μ—†μŠ΅λ‹ˆλ‹€. API 응닡:`, data);
1870
1894
  }
1871
1895
  }
1872
1896
  catch (error) {
1873
- console.error(`Failed to load slot ${slot.id}:`, error);
1897
+ console.error(`❌ 슬둯 ${slot.id} λ‘œλ“œ μ‹€νŒ¨:`, error);
1874
1898
  }
1875
1899
  }
1876
1900
  /**
@@ -1878,8 +1902,18 @@ class AdStageSDK {
1878
1902
  */
1879
1903
  renderSlotWithSlider(slot, advertisements, options) {
1880
1904
  const container = DOMUtils.safeGetElementById(slot.containerId);
1881
- if (!container)
1905
+ if (!container) {
1906
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
1882
1907
  return;
1908
+ }
1909
+ if (this.config.debug) {
1910
+ console.log(`🎨 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
1911
+ slotId: slot.id,
1912
+ containerId: slot.containerId,
1913
+ advertisementCount: advertisements.length,
1914
+ container: container
1915
+ });
1916
+ }
1883
1917
  if (advertisements.length === 1) {
1884
1918
  // κ΄‘κ³ κ°€ ν•˜λ‚˜λΏμ΄λ©΄ κΈ°λ³Έ λ Œλ”λ§
1885
1919
  this.renderSlot(slot, advertisements[0]);
@@ -1903,7 +1937,11 @@ class AdStageSDK {
1903
1937
  slot.isLoaded = true;
1904
1938
  if (this.config.debug) {
1905
1939
  const sliderType = useFadeEffect ? 'fade slider' : 'slider';
1906
- console.log(`Rendered ${advertisements.length} ads with ${sliderType} for slot ${slot.id}:`, advertisements);
1940
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³ λ₯Ό ${sliderType}둜 λ Œλ”λ§ μ™„λ£Œ:`, {
1941
+ slotId: slot.id,
1942
+ container: container,
1943
+ sliderContainer: sliderContainer
1944
+ });
1907
1945
  }
1908
1946
  }
1909
1947
  /**
@@ -1911,15 +1949,36 @@ class AdStageSDK {
1911
1949
  */
1912
1950
  renderSlot(slot, ad) {
1913
1951
  const container = DOMUtils.safeGetElementById(slot.containerId);
1914
- if (!container)
1952
+ if (!container) {
1953
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
1915
1954
  return;
1955
+ }
1956
+ if (this.config.debug) {
1957
+ console.log(`🎨 단일 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
1958
+ slotId: slot.id,
1959
+ containerId: slot.containerId,
1960
+ ad: ad,
1961
+ container: container
1962
+ });
1963
+ }
1916
1964
  // νŒ©ν† λ¦¬λ₯Ό μ‚¬μš©ν•΄μ„œ μ μ ˆν•œ λ Œλ”λŸ¬λ‘œ κ΄‘κ³  생성
1917
1965
  const adElement = AdRendererFactory.render(ad, slot, (adId, slotId, eventType) => this.eventTracker.trackEvent(adId, slotId, eventType));
1966
+ if (this.config.debug) {
1967
+ console.log(`πŸ”§ κ΄‘κ³  μš”μ†Œ 생성됨:`, {
1968
+ adElement: adElement,
1969
+ tagName: adElement.tagName,
1970
+ innerHTML: adElement.innerHTML.substring(0, 200) + '...'
1971
+ });
1972
+ }
1918
1973
  container.innerHTML = '';
1919
1974
  container.appendChild(adElement);
1920
1975
  slot.isLoaded = true;
1921
1976
  if (this.config.debug) {
1922
- console.log(`Rendered ad for slot ${slot.id}:`, ad);
1977
+ console.log(`βœ… 단일 κ΄‘κ³  λ Œλ”λ§ μ™„λ£Œ:`, {
1978
+ slotId: slot.id,
1979
+ ad: ad,
1980
+ containerContent: container.innerHTML.substring(0, 200) + '...'
1981
+ });
1923
1982
  }
1924
1983
  }
1925
1984
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adstage/web-sdk",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "AdStage Web SDK for displaying advertisements",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
package/src/index.ts CHANGED
@@ -127,34 +127,61 @@ export class AdStageSDK {
127
127
  ...(options?.country && { country: options.country }),
128
128
  });
129
129
 
130
- const response = await fetch(
131
- `${this.baseUrl}/advertisements/list?${queryParams}`,
132
- {
133
- headers: {
134
- 'x-api-key': this.config.apiKey,
135
- 'Content-Type': 'application/json',
136
- },
137
- }
138
- );
130
+ const requestUrl = `${this.baseUrl}/advertisements/list?${queryParams}`;
131
+
132
+ if (this.config.debug) {
133
+ console.log(`🌐 κ΄‘κ³  API μš”μ²­ μ‹œμž‘:`, {
134
+ url: requestUrl,
135
+ apiKey: this.config.apiKey.substring(0, 10) + '...',
136
+ slot: slot.id
137
+ });
138
+ }
139
+
140
+ const response = await fetch(requestUrl, {
141
+ headers: {
142
+ 'x-api-key': this.config.apiKey,
143
+ 'Content-Type': 'application/json',
144
+ },
145
+ });
146
+
147
+ if (this.config.debug) {
148
+ console.log(`πŸ“‘ API 응닡 μƒνƒœ:`, {
149
+ status: response.status,
150
+ statusText: response.statusText,
151
+ ok: response.ok
152
+ });
153
+ }
139
154
 
140
155
  if (!response.ok) {
141
156
  throw new Error(`HTTP error! status: ${response.status}`);
142
157
  }
143
158
 
144
159
  const data = await response.json();
160
+
161
+ if (this.config.debug) {
162
+ console.log(`πŸ“Š API 응닡 데이터:`, {
163
+ data,
164
+ advertisementsCount: data.advertisements ? data.advertisements.length : 0
165
+ });
166
+ }
167
+
145
168
  const advertisements = data.advertisements || [];
146
169
 
147
170
  if (advertisements.length > 0) {
171
+ if (this.config.debug) {
172
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³  발견:`, advertisements);
173
+ }
174
+
148
175
  // μ—¬λŸ¬ κ΄‘κ³ κ°€ μžˆμ„ 경우 μŠ¬λΌμ΄λ“œλ‘œ λ Œλ”λ§
149
176
  this.renderSlotWithSlider(slot, advertisements, options);
150
177
 
151
178
  // 첫 번째 광고에 λŒ€ν•΄μ„œλ§Œ λ…ΈμΆœ 이벀트 좔적
152
179
  await this.eventTracker.trackEvent(advertisements[0]._id, slot.id, AdEventType.IMPRESSION);
153
180
  } else {
154
- console.warn(`No advertisements available for slot ${slot.id}`);
181
+ console.warn(`⚠️ 슬둯 ${slot.id}에 μ‚¬μš© κ°€λŠ₯ν•œ κ΄‘κ³ κ°€ μ—†μŠ΅λ‹ˆλ‹€. API 응닡:`, data);
155
182
  }
156
183
  } catch (error) {
157
- console.error(`Failed to load slot ${slot.id}:`, error);
184
+ console.error(`❌ 슬둯 ${slot.id} λ‘œλ“œ μ‹€νŒ¨:`, error);
158
185
  }
159
186
  }
160
187
 
@@ -163,7 +190,19 @@ export class AdStageSDK {
163
190
  */
164
191
  private renderSlotWithSlider(slot: AdSlot, advertisements: Advertisement[], options?: any): void {
165
192
  const container = DOMUtils.safeGetElementById(slot.containerId);
166
- if (!container) return;
193
+ if (!container) {
194
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
195
+ return;
196
+ }
197
+
198
+ if (this.config.debug) {
199
+ console.log(`🎨 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
200
+ slotId: slot.id,
201
+ containerId: slot.containerId,
202
+ advertisementCount: advertisements.length,
203
+ container: container
204
+ });
205
+ }
167
206
 
168
207
  if (advertisements.length === 1) {
169
208
  // κ΄‘κ³ κ°€ ν•˜λ‚˜λΏμ΄λ©΄ κΈ°λ³Έ λ Œλ”λ§
@@ -202,7 +241,11 @@ export class AdStageSDK {
202
241
 
203
242
  if (this.config.debug) {
204
243
  const sliderType = useFadeEffect ? 'fade slider' : 'slider';
205
- console.log(`Rendered ${advertisements.length} ads with ${sliderType} for slot ${slot.id}:`, advertisements);
244
+ console.log(`βœ… ${advertisements.length}개 κ΄‘κ³ λ₯Ό ${sliderType}둜 λ Œλ”λ§ μ™„λ£Œ:`, {
245
+ slotId: slot.id,
246
+ container: container,
247
+ sliderContainer: sliderContainer
248
+ });
206
249
  }
207
250
  }
208
251
 
@@ -211,7 +254,19 @@ export class AdStageSDK {
211
254
  */
212
255
  private renderSlot(slot: AdSlot, ad: Advertisement): void {
213
256
  const container = DOMUtils.safeGetElementById(slot.containerId);
214
- if (!container) return;
257
+ if (!container) {
258
+ console.error(`❌ μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€: ${slot.containerId}`);
259
+ return;
260
+ }
261
+
262
+ if (this.config.debug) {
263
+ console.log(`🎨 단일 κ΄‘κ³  λ Œλ”λ§ μ‹œμž‘:`, {
264
+ slotId: slot.id,
265
+ containerId: slot.containerId,
266
+ ad: ad,
267
+ container: container
268
+ });
269
+ }
215
270
 
216
271
  // νŒ©ν† λ¦¬λ₯Ό μ‚¬μš©ν•΄μ„œ μ μ ˆν•œ λ Œλ”λŸ¬λ‘œ κ΄‘κ³  생성
217
272
  const adElement = AdRendererFactory.render(
@@ -220,12 +275,24 @@ export class AdStageSDK {
220
275
  (adId, slotId, eventType) => this.eventTracker.trackEvent(adId, slotId, eventType)
221
276
  );
222
277
 
278
+ if (this.config.debug) {
279
+ console.log(`πŸ”§ κ΄‘κ³  μš”μ†Œ 생성됨:`, {
280
+ adElement: adElement,
281
+ tagName: adElement.tagName,
282
+ innerHTML: adElement.innerHTML.substring(0, 200) + '...'
283
+ });
284
+ }
285
+
223
286
  container.innerHTML = '';
224
287
  container.appendChild(adElement);
225
288
  slot.isLoaded = true;
226
289
 
227
290
  if (this.config.debug) {
228
- console.log(`Rendered ad for slot ${slot.id}:`, ad);
291
+ console.log(`βœ… 단일 κ΄‘κ³  λ Œλ”λ§ μ™„λ£Œ:`, {
292
+ slotId: slot.id,
293
+ ad: ad,
294
+ containerContent: container.innerHTML.substring(0, 200) + '...'
295
+ });
229
296
  }
230
297
  }
231
298