Kaynağa Gözat

회원 광고 스크립트 추가

jsshin 5 yıl önce
ebeveyn
işleme
12bdef8f18

+ 12 - 0
src/main/java/com/style24/persistence/domain/Login.java

@@ -35,6 +35,8 @@ public class Login extends TscBaseDomain {
 	private String custStat;		// 고객상태
 	private String cellPhnno;		// 휴대전화번호
 	private String email;			// 이메일
+	private String birthYmd;		// 생년월일
+	private String sexGb;			// 성별
 	private String snsType;			// SNS유형
 	private String snsId;			// SNS가입ID
 	private int loginFailCnt;		// 로그인실패건수
@@ -63,6 +65,16 @@ public class Login extends TscBaseDomain {
 		this.email = CryptoUtils.decryptAES(this.email);
 		return this.email;
 	}
+
+	public String getBirthYmd() {
+		this.birthYmd = CryptoUtils.decryptAES(this.birthYmd);
+		return this.birthYmd;
+	}
+
+	public String getSexGb() {
+		this.sexGb = CryptoUtils.decryptAES(this.sexGb);
+		return this.sexGb;
+	}
 	// 암호화 대상 복호화 처리 =================================================
 
 }

+ 2 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfLogin.xml

@@ -29,6 +29,8 @@
 		     , TEMP_PASSWD_YN                                            /*임시비밀번호여부*/
 		     , IFNULL(DATEDIFF(NOW(),PASSWD_CHG_DT),0) AS PWD_CHG_DAY    /*비밀번호변경일자*/
 		     , CI                                                        /*CI본인인증여부*/
+		     , BIRTH_YMD                                                 /*생년월일*/
+		     , SEX_GB                                                    /*성별*/
 		FROM   TB_CUSTOMER A
 		WHERE  1 = 1
 		<choose>

+ 51 - 4
src/main/webapp/WEB-INF/views/web/common/fragments/HeadWeb.html

@@ -82,23 +82,28 @@
 // 		gtag('config', 'UA-168660512-1');
 	</script>
 	
-	<th:block th:if="${sessioninfo != null}">
+	<th:block th:if="${sessionInfo != null}">
 		<script th:inline="javascript">
 		/*<![CDATA[*/
 			var gCustId = [[${sessionInfo.custId}]];
-			var gEmail = [[${sessionInfo.Email}]];
+			var gEmail = [[${sessionInfo.email}]];
+			var gGender = [[${sessionInfo.sexGb}]];
+			var gBirthYmd = [[${sessionInfo.birthYmd}]];
 			/*]]>*/
 		</script>
 	</th:block>
-	<th:block th:if="${sessioninfo == null}">
+	<th:block th:if="${sessionInfo == null}">
 		<script th:inline="javascript">
 		/*<![CDATA[*/
 			var gCustId = '';
 			var gEmail = '';
+			var gGender = '';
+			var gBirthYmd = '';
 			/*]]>*/
 		</script>
 	</th:block>
-	
+
+	<script type="text/javascript" th:src="@{'/ux/plugins/gaga/gaga.validation.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/plugins/gaga/gaga.validation.js"></script>
 	<script src="/ux/sha512.min.js"></script>
 	<script>
 		String.prototype.hashCode = function() {
@@ -125,6 +130,48 @@
 			x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
 		})();
 		/* \\Eiengine Script (Visit) */
+
+		// 로그인 성공 시 - 시작
+
+		// 나이대 구하기 31 -> 30
+		var fnGetAge = function (birthYmd) {
+			let age = '';
+			if (!gagajf.isNull(birthYmd) && birthYmd.length > 7) {
+				let year = Number(new Date().getFullYear());
+				let curretAge = year - Number(birthYmd.substr(0, 4));
+				age = String(curretAge).substr(0 , 1) + '0';
+			}
+			return age;
+		}
+		// 성별 공통코드 값 M-> A, F-> B
+		var fnGetGender = function (gGender) {
+			let gender = ''
+			if (!gagajf.isNull(gGender)) {
+				gender = gGender.substr(5,6) === 'M' ? 'A' : 'B';
+			}
+			return gender;
+		}
+
+		let loginSuccessYn = gagajf.getCookie('st24ck_login_success');
+		if (loginSuccessYn === 'Y') {
+			gagajf.setCookie('st24ck_login_success', '', 0);
+			let age = fnGetAge(gBirthYmd);
+			let gender = fnGetGender(gGender);
+			window._eglqueue = window._eglqueue || [];
+			_eglqueue.push(['setVar','cuid', eglqueueCuid]);
+			_eglqueue.push(['setVar','userId', hCustId]);
+			_eglqueue.push(['setVar','gender', gender]);
+			_eglqueue.push(['setVar','age', age]);
+			_eglqueue.push(['track','user']);
+			(function (s, x) {
+				s = document.createElement('script'); s.type = 'text/javascript';
+				s.async = true; s.defer = true; s.src = (('https:' == document.location.protocol) ? 'https' : 'http') + '://logger.eigene.io/js/logger.min.js';
+				x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
+			})();
+		}
+		
+
+		// 로그인 성공 시 - 끝
 	</script>
 </head>