1var GOOGLE_ANAUYTICS = function(){ 2 var order_info = []; 3 4 /* 주문 ì ë³´ì ë£ì´ì¤ ë°ì´í° ì기 */ 5 var AddorderInfo = function(prod_no, prod_name, prod_price, prod_count){ /* ì ììê±°ë ëë리기 ì prod_count를 ìì ìëì¼ë¡ ë£ì´ì¤ */ 6 order_info.push({ 7 'id' : prod_no, 8 'name' : prod_name, 9 'price' : prod_price, 10 'quantity' : prod_count 11 }); 12 }; 13 14 /* ê²°ì ì ë³´ */ 15 var Completepayment = function(order_no, total_price,currency,is_npay){ 16 if(is_npay === true){ 17 gtag('event', 'purchase', { 18 "transaction_id" : order_no, 19 "affiliation" : "Npay", 20 "value" : total_price, 21 "currency" : currency, 22 "items" : order_info 23 }); 24 }else{ 25 gtag('event', 'purchase', { 26 "transaction_id" : order_no, 27 "value" : total_price, 28 "currency" : currency, 29 "items" : order_info 30 }); 31 } 32 }; 33 34 /* ì í 걸기 */ 35 var Calltellephone = function(eventLabel){ 36 ga('send', 'event', 'ì í걸기', 'ë§í¬í´ë¦', eventLabel, '1'); 37 }; 38 39 /* ì ìì ê±°ë íì (íë¶,ë°í) */ 40 var ReversePayment = function(info){ 41 for(var i = 0; i < info.length; i++){ 42 ga('ecommerce:addItem', info[i]); 43 } 44 ga('ecommerce:send'); 45 }; 46 47 var use_npay_count = false; 48 var setUseNpayCount = function(b){ 49 use_npay_count = (b === true); 50 }; 51 52 var addNpayOrder = function(order_data){ 53 if(!use_npay_count) return false; 54 if(typeof order_data == 'undefined') return false; 55 if(typeof order_data['list'] == 'undefined') return false; 56 // ë¤ì´ë² íì´ë 구매ì íì í¬í¨íê²ë ìµì ì ì¬ì©í ê²½ì°ìë 구매ìë£ë¥¼ ë°ë¡ ë³´ë¸ë¤ 57 58 var np_ga_data = {'order_no' : '', 'total_price' : 0}; 59 var npay_order_item = {}; 60 for(var i = 0; i < order_data['list'].length; i++){ 61 npay_order_item = order_data['list'][i]; 62 if(np_ga_data['order_no'] == ''){ 63 np_ga_data['order_no'] = npay_order_item['order_no']; 64 } 65 AddorderInfo(npay_order_item['prod_idx'], npay_order_item['prod_name'], npay_order_item['price'], npay_order_item['count']); 66 } 67 np_ga_data['total_price'] = order_data['total_price']; 68 69 Completepayment(np_ga_data['order_no'], np_ga_data['total_price'],'KRW',true); 70 }; 71 72 var GA4 = { 73 view_item: function(params) { 74 __event('view_item', params); 75 }, 76 add_to_cart: function(params) { 77 __event('add_to_cart', params); 78 } 79 }; 80 81 var __event = function(event, params) { 82 gtag('event', event, params); 83 }; 84 85 return { 86 "AddorderInfo" : function(prod_no, prod_name, prod_price, prod_count){ 87 AddorderInfo(prod_no, prod_name, prod_price, prod_count); 88 }, 89 "Completepayment" : function(order_no, total_price,currency){ 90 Completepayment(order_no, total_price,currency,false); 91 }, 92 "Calltellephone" : function(eventLabel){ 93 Calltellephone(eventLabel); 94 }, 95 "ReversePayment" : function(info){ 96 ReversePayment(info); 97 }, 98 "setUseNpayCount" : function(b){ 99 setUseNpayCount(b); 100 }, 101 "addNpayOrder" : function(order_data){ 102 addNpayOrder(order_data); 103 }, 104 GA4: { 105 view_item: function(params) { 106 GA4.view_item(params); 107 }, 108 add_to_cart: function(params) { 109 GA4.add_to_cart(params); 110 } 111 } 112 } 113}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.