-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsample_genData_from_php_lib.php
More file actions
272 lines (264 loc) · 10.1 KB
/
sample_genData_from_php_lib.php
File metadata and controls
272 lines (264 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<?php
require_once './libs/cls_ga.php';
$data = array(
'trackingID' => 'UA-74300583-1',
'plugins' => array('displayfeatures', 'ecommerce'),
'signEsc' => 'ga-esc',
'sampleRate' => '100',
'customDefinitions' => array(
'document_group' => 'itempage',
'cat1' => '2092101501',
'cat2' => '2092073468',
'cat3' => '2092097929',
'cat4' => '2092097930',
'cat5' => 'none',
'cat6' => 'none',
'cat1Name' => '女包精品與女鞋',
'cat2Name' => '皮夾',
'cat3Name' => '零錢包',
'cat4Name' => '拉鍊式零錢包',
'cat5Name' => 'none',
'cat6Name' => 'none',
'seller' => 'Y3056254072',
'itemid' => '100144234642',
'spaceid' => '2092111773',
'subtype' => 'buynow'
),
'cdMap' => array(
'document_group' => 'contentGroup1',
'document_name' => 'dimension1',
'subtype' => 'dimension2',
'cat1Name' => 'dimension3',
'cat2Name' => 'dimension4',
'cat3Name' => 'dimension5',
'cat4Name' => 'dimension6',
'cat5Name' => 'dimension7',
'cat6Name' => 'dimension8',
'cat1' => 'dimension9',
'cat2' => 'dimension10',
'cat3' => 'dimension11',
'cat4' => 'dimension12',
'cat5' => 'dimension13',
'cat6' => 'dimension14',
'itemid' => 'dimension15',
'itemname' => 'dimension16',
'seller' => 'dimension17',
'sellerName' => 'dimension18',
'promotion_id' => 'dimension19',
'activity_id' => 'dimension20',
'checkout_step' => 'dimension21',
'paytype' => 'dimension22',
'delvtype' => 'dimension23',
'vtestid' => 'dimension24',
'spaceid' => 'dimension25',
'coServerName' => 'dimension26',
'coServerName2' => 'dimension27',
'actCode' => 'dimension28',
'bidType' => 'dimension30'
),
'trackedMods' => array(
'.mei' => 'trackedMod01',
'#mei' => 'trackedMod02'
),
'ecommerce' => array(
'transaction' => array(
'id' => '1234',
'affiliation' => 'Acme Clothing',
'revenue' => '11.99',
'shipping' => '5',
'tax' => '1.29'
),
'item' => array(
array(
'id' => '1234',
'name' => 'Fluffy Pink Bunnies',
'sku' => 'DD23444',
'category' => 'Party Toys',
'price' => '11.99',
'quantity' => '1'
),
array(
'id' => '1235',
'name' => 'Fluffy Pink Bunnies2',
'sku' => 'DD23445',
'category' => 'Party Toys',
'price' => '19.99',
'quantity' => '2'
)
)
)
);
$ga = new GA();
$ga = $ga->genConf($data);
?>
<!DOCTYPE html>
<html lang="en" x-frame-options="sameorigin">
<head>
<meta http-equiv="Content-Security-Policy1" content="default-src 'self' www.google-analytics.com; font-src * data:; style-src 'self' 'unsafe-inline'; img-src www.google-analytics.com;">
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="Expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
<meta http-equiv="x-frame-options" content="sameorigin">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="GoogleAnalytics,ga,gaExt">
<meta name="description" content="藉由「gaExt」的導入, 可以大大的增強 Google Analytics 功能以及安裝初始設定, 簡單幾個設定便可以輕輕鬆鬆 tracking 到頁面 module view 以及 module click, 更可以避免 inline script 可能潛伏的 XSS 危機, 讓原本使用 Google Analytics 更為簡單, 愈加便利!!">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@mei">
<meta name="twitter:creator" content="@mei">
<meta name="twitter:title" content="gaExt - enhance and complete Google Analytics features">
<meta name="twitter:description" content="藉由「gaExt」的導入, 可以大大的增強 Google Analytics 功能以及安裝初始設定, 簡單幾個設定便可以輕輕鬆鬆 tracking 到頁面 module view 以及 module click, 更可以避免 inline script 可能潛伏的 XSS 危機, 讓原本使用 Google Analytics 更為簡單, 愈加便利!!">
<meta name="twitter:image:src" content="http://mei.homin.com.tw/img/preview/gaExt.png">
<meta property="og:title" content="gaExt - enhance and complete Google Analytics features">
<meta property="og:site_name" content="mei">
<meta property="og:description" content="藉由「gaExt」的導入, 可以大大的增強 Google Analytics 功能以及安裝初始設定, 簡單幾個設定便可以輕輕鬆鬆 tracking 到頁面 module view 以及 module click, 更可以避免 inline script 可能潛伏的 XSS 危機, 讓原本使用 Google Analytics 更為簡單, 愈加便利!!">
<meta property="og:image" content="http://mei.homin.com.tw/img/preview/gaExt.png">
<title>gaExt - enhance and complete Google Analytics features</title>
<link rel="dns-prefetch" href="//mei.homin.com.tw">
<link rel="canonical" href="http://mei.homin.com.tw/GAPrototype.html">
<link rel="stylesheet" href="css/cssbase.css">
<link href="css/adornFormElements.css" rel="stylesheet">
<script src="script/pageRender.js" data-source="script/prototype-min.js&script/func.js&script/swiftMarkClass.js&script/socialShareClass.js&script/gaExt.js"></script>
<style>
#mei{margin-bottom:10px;}
#mei a+a{margin-left:7px;}
</style>
</head>
<body>
<header id="hd" role="banner">
<h1>gaExt - enhance and complete Google Analytics features</h1>
</header>
<main id="bd" role="main">
<section>
<h3>GA tracking elements</h3>
<div id="mei">
<a href="#" class="buttons mei-b" data-slk="links">This is tag <a></a>
<a href="#" class="buttons mei-b">This is tag <a> without data-slk</a>
<a href="#" class="buttons mei-b"><span>This is tag <a> wrapped by othe tags</span></a>
</div>
<form class="mei" method="post">
<label class="inputText">
<span>input[type=text]</span>
<input class="decoration" placeholder="input [type=text]" maxlength="40">
</label>
<label class="textarea">
<span>textarea</span>
<textarea class="decoration" placeholder="textarea"></textarea>
</label>
<div class="radios mei-g">
<div class="radio mei-u">
<input id="radio0" type="radio" name="adornRadio" value="adornRadio0" checked>
<label for="radio0">Radio 0</label>
</div>
<div class="radio mei-u">
<input id="radio1" type="radio" name="adornRadio" value="adornRadio1" disabled>
<label for="radio1">Radio 1 (disabled)</label>
</div>
<div class="radio mei-u">
<input id="radio2" type="radio" name="adornRadio" value="adornRadio2">
<label for="radio2">Radio 2</label>
</div>
<div class="radio mei-u">
<input id="radio3" type="radio" name="adornRadio" value="adornRadio3">
<label for="radio3">Radio 3</label>
</div>
<div class="radio mei-u">
<input id="radio4" type="radio" name="adornRadio" value="adornRadio4">
<label for="radio4">Radio 4</label>
</div>
</div>
<div class="checkboxes mei-g">
<div class="checkbox mei-u">
<input id="checkbox0" type="checkbox" name="adornCheckbox" value="adornCheck0" checked>
<label for="checkbox0">Checkbox 0</label>
</div>
<div class="checkbox mei-u">
<input id="checkbox1" type="checkbox" name="adornCheckbox" value="adornCheck1" disabled>
<label for="checkbox1">Checkbox 1 (disabled)</label>
</div>
<div class="checkbox mei-u">
<input id="checkbox2" type="checkbox" name="adornCheckbox" value="adornCheck2">
<label for="checkbox2">Checkbox 2</label>
</div>
<div class="checkbox mei-u">
<input id="checkbox3" type="checkbox" name="adornCheckbox" value="adornCheck3">
<label for="checkbox3">Checkbox 3</label>
</div>
<div class="checkbox mei-u">
<input id="checkbox4" type="checkbox" name="adornCheckbox" value="adornCheck4">
<label for="checkbox4">Checkbox 4</label>
</div>
</div>
<label class="mei-b select-wrap">
<p>select</p>
<select>
<option selected disabled>Select</option>
<option value="select0">option0</option>
<option value="select1">option1</option>
<option value="select2">option2</option>
</select>
<em>arrow</em>
</label>
<div class="button-wrap mei-g">
<label class="filePicker mei-b decoration">
Pick up file
<input type="file" multiple data-slk="inputFile">
</label>
<input type="submit" class="buttons mei-b decoration" value="Submit">
<button class="buttons mei-b decoration">Button</button>
</div>
</form>
</section>
<swiftmark-module data-position="top-right" hidden>
<h3>gaExt</h3>
<a href="http://mei.homin.com.tw/GAPrototype.html" title="gaExt">
<img src="img/gaExt/qrcode.png">
</a>
</swiftmark-module>
<socialshare-module data-position="top-left" hidden>
<h3>socialShare</h3>
<a href="#facebook">share to facebook</a>
<a href="#twitter">share to twitter</a>
<a href="#tumblr">share to tumblr</a>
<a href="#googleplus">share to googleplus</a>
<a href="#pinterest">share to pinterest</a>
<a href="#blogger">share to blogger</a>
<a href="#mail">share to mail</a>
</socialshare-module>
</main>
<footer id="ft">
<small role="contentinfo">Powered by mei's studio.</small>
<?php echo $ga; ?>
</footer>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "CreativeWork",
"name": "gaExt prototype",
"url": "http://mei.homin.com.tw/GAPrototype.html",
"description": "藉由「gaExt」的導入, 可以大大的增強 Google Analytics 功能以及安裝初始設定, 簡單幾個設定便可以輕輕鬆鬆 tracking 到頁面 module view 以及 module click, 更可以避免 inline script 可能潛伏的 XSS 危機, 讓原本使用 Google Analytics 更為簡單, 愈加便利!!",
"image": "http://mei.homin.com.tw/img/preview/gaExt.png",
"author": {
"@type": "Person",
"name": "Paul Li",
"jobTitle": "Front End engineer",
"affiliation": "mei's studio",
"additionalName": "mei",
"url": "https://www.facebook.com/mei.studio.li",
"image": "https://graph.facebook.com/mei.studio.li/picture",
"brand": "mei's studio",
"familyName": "Li",
"gender": "M",
"givenName": "Paul",
"owns": "mei's studio",
"worksFor": "Yahoo",
"description": "People who loves all front end skills"
},
"dateCreated": "2016-03-08",
"datePublished": "2016-03-08",
"genre": "google analytics",
"keywords": "google analytics,ga,gaExt"
}
</script>
</body>
</html>