-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
91 lines (83 loc) · 4.06 KB
/
header.php
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
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" charset="utf-8"
type="text/javascript"></script>
<script src="js/jquery.cookie.js" charset="utf-8" type="text/javascript"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.css"/>
<link rel="stylesheet" href="css/bootstrap-responsive.css"/>
<script src="js/bootstrap.js" charset="utf-8" type="text/javascript"></script>
<!-- End Bootstrap -->
<link rel="stylesheet" href="css/mystyle.css"/>
<script src="js/shopping_script.js" charset="utf-8" type="text/javascript"></script>
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="img/ico/favicon.png">
<!-- End Fav and touch icons -->
<!-- Google Analytics -->
<script type="text/javascript" charset="utf-8">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-41294141-2']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
if (window.location.pathname == '/thankyou.html.php') {
console.log('thank you page');
if ($.cookie().hasOwnProperty('adres') && ($.cookie().hasOwnProperty('iphone') || $.cookie().hasOwnProperty('htc_one'))) {
console.log('create trans for analytics');
var order = [];
var totalPrice = 0;
var randomNumber = Math.floor(Math.random() * 10000001);
var json;
for (var prop in $.cookie()) {
switch (prop) {
case 'adres':
json = JSON.parse($.cookie(prop));
order.push('_addTrans');
order.push(String(randomNumber));
order.push('A/B Testing shop');
order.push(json.stad);
order.push(json.stad);
order.push('NL');
$.removeCookie(prop);
break;
case 'iphone':
case 'htc_one':
json = JSON.parse($.cookie(prop));
var item = [];
item.push('_addItem');
item.push(String(randomNumber));
item.push(String(json.productName));
item.push(String(json.productName));
item.push('smartphones');
item.push(String(json.price));
item.push(String(json.quantity));
$.removeCookie(prop);
_gaq.push(item);
totalPrice += json.price * json.quantity;
break;
}
}
var tax = totalPrice * 0.19;
order.splice(2, 0, [String(totalPrice), String(tax), String(6.75)]);
_gaq.push(order);
_gaq.push(['_trackTrans']);
console.log(_gaq);
}
}
</script>
<script type="text/javascript" charset="utf-8">(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41294141-1');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->