merge master into develop - CscListRForm.jsp FAQ 아코디언 버그 수정
This commit is contained in:
69
build/resources/main/static/js/adscript/adscript.js
Normal file
69
build/resources/main/static/js/adscript/adscript.js
Normal file
@@ -0,0 +1,69 @@
|
||||
$(window).on('load',function() {
|
||||
const adScriptUrl = '/sopmal/adscript/selectAdScriptList';
|
||||
// 여기서 필요한 정보를 담을수 있또록 해야 할것 같음
|
||||
// AJAX 요청 보내기
|
||||
$.ajax({
|
||||
url: adScriptUrl,
|
||||
contentType: 'application/json',
|
||||
method: 'post',
|
||||
data: JSON.stringify({'sopmalCd' : ''}),
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
const result = JSON.parse(response.resBody.result).selectAdScriptList
|
||||
|
||||
|
||||
//현재 경로
|
||||
let locationUrl = window.location.pathname;
|
||||
|
||||
//상품이 존재하지 않을 경우 아래 스크립트에 영향이 있을 수 있음
|
||||
//광고스크립트가 상품상세 js 보다 우선 실행되기 때문에 상품 상세에 걸어도 걸리지 않아 여기서 처리
|
||||
if(locationUrl.includes(selectGoodsDtl) && $('#goodsUseAt').val()==="N"){
|
||||
alert('존재하지 않는 상품 입니다.')
|
||||
history.back()
|
||||
}
|
||||
|
||||
|
||||
if(fn_is_empty(result)){
|
||||
return false;
|
||||
}
|
||||
|
||||
//광고매체 구분
|
||||
|
||||
//구글애즈
|
||||
googleAds(adMediaList(result, '01'), locationUrl)
|
||||
//구글애널리틱스
|
||||
googleAnalytics(adMediaList(result, '02'), locationUrl);
|
||||
//구글태그매니저
|
||||
googleTagManager(adMediaList(result, '03'), locationUrl);
|
||||
//메타
|
||||
meta(adMediaList(result, '04'), locationUrl)
|
||||
//카카오모먼츠
|
||||
kakaoMoments(adMediaList(result, '05'), locationUrl)
|
||||
//크리테오
|
||||
criteo(adMediaList(result, '06'), locationUrl)
|
||||
//TG
|
||||
targetingGates(adMediaList(result, '07'), locationUrl)
|
||||
//틱톡(사용처 없음)
|
||||
|
||||
//애드패커(사용처 없음)
|
||||
|
||||
//모비온
|
||||
mobion(adMediaList(result, '10'), locationUrl)
|
||||
//ADN2
|
||||
adn2dot0(adMediaList(result, '11'), locationUrl)
|
||||
//AND3(GTM으로 관리)
|
||||
|
||||
//리얼클릭(사용처 없음)
|
||||
|
||||
//네이버검색광고
|
||||
naverSrchAds(adMediaList(result, '14'), locationUrl)
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//광고 매체별 리스트 필터링 함수
|
||||
function adMediaList(list, adMediaDvCd){
|
||||
return list.filter(item => item.adMediaDvCd === adMediaDvCd)
|
||||
}
|
||||
});//window.onload END
|
||||
Reference in New Issue
Block a user