PageSourceSearch

https://artemuseum.com/js/google_analytics.js?1686556171

js artemuseum.com collected 2026-09-24 09:35:26 UTC 3,125 bytes, 113 lines download raw bytes

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.