-
Notifications
You must be signed in to change notification settings - Fork 46
/
index.html
executable file
·146 lines (136 loc) · 5.33 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Adobe Lab: Real-time Dashboard</title>
<link rel="stylesheet" href="css/main.css" type="text/css" />
<!--Include the libraries we will be using -->
<script src="js/jquery-2.2.3.min.js" type="text/javascript"></script>
<!-- Using D3 for Charting -->
<script src="js/d3.v2.js" type="text/javascript" ></script>
<script src="js/d3.animated_trend.js" type="text/javascript"></script>
<!-- Using the Marketing Javascript SDK to pull the data -->
<script src="js/marketing-cloud-javascript-sdk/wsse.js" type="text/javascript"></script>
<script src="js/marketing-cloud-javascript-sdk/marketing_cloud.js" type="text/javascript"></script>
<script src="js/jquery-animateNumber/jquery.animateNumber.min.js" type="text/javascript"></script>
<script src="js/config.js" type="text/javascript"></script>
<script src="js/custom.js" type="text/javascript"></script>
<script src="js/jquery.basic_table.js" type="text/javascript"></script>
<script src="js/real_time_report.js" type="text/javascript"></script>
<script type="text/javascript">
// code to run when the HTML is fully loaded
$( document ).ready(function() {
//////////////////////////////////
// COMPANY.GETREPORTSUITES EXAMPLE
//////////////////////////////////
MarketingCloud.makeRequest(config.username, config.secret, 'Company.GetReportSuites', {}, config.endpoint, function(response) {
$('#dashboard').html(JSON.stringify(response.responseJSON));
});
/*
///////////////////////////
// BASIC REPORT.RUN REQUEST
///////////////////////////
MarketingCloud.makeRequest(config.username, config.secret, 'Report.Run', {
"reportDescription": {
"source": "realtime",
"reportSuiteID": "rtd-example",
"metrics": [
{ "id": "instances" }
], "elements": [
{ "id": "page" }
],
"dateGranularity": "minute:1",
"dateFrom": "-15 minutes"
}
}, config.endpoint, function(response) {
$('#dashboard').html(JSON.stringify(response.responseJSON));
});
*/
/*
///////////////////////////
// MOST POPULAR REPORT
///////////////////////////
var report = new RealTimeReport({
dataElement: "#data-table",
dataElementType: "BasicTable",
totalElement: null,
animateTotal: false,
refreshInterval: null
});
report.run({
"reportDescription": {
"source": "realtime",
"reportSuiteID": "rtd-example",
"algorithm": "most popular",
"metrics": [
{ "id": "instances" }
], "elements": [
{ "id": "page" }
],
"dateGranularity": "minute:60",
"dateFrom": "-20 hours",
"sortMethod": "mostpopular"
}
});
*/
/*
///////////////////////////
// TREND GRAPH REPORT
///////////////////////////
report = new RealTimeReport({
dataElement: "#trendGraph",
dataElementType: "BasicTable",
totalElement: null,
animateTotal: false,
refreshInterval: null
});
report.run({
"reportDescription": {
"source": "realtime",
"reportSuiteID": "rtd-example",
"algorithm": "most popular",
"metrics": [
{ "id": "instances" }
], "elements": [
{ "id": "page" }
],
"dateGranularity": "minute:1",
"dateFrom": "-15 minutes",
"sortMethod": "mostpopular"
}
});
*/
});
</script>
</head>
<body id="index" class="home">
<div id="header">
<div id="links" class="content">
Adobe Real-time Dashboard Made by YOU
</div>
</div>
<div id="dashboard" class="content">
<div id="numberWidget" class="widget third">
<span id="total" class="number"><span class="wait"></span></span>
</div>
<div id="trendGraph" class="widget twothirds"></div>
<div id="1half" class="widget half">
<div id="ranked" class="widget">
<label class="hidden">Most Popular</label>
<div id="data-table"> </div>
</div>
<div id="legend"> </div>
</div>
<div id="2half" class="widget half">
<div id="gainers" class="widget">
<label class="hidden">Gainers</label>
<div id="gainers-table"> </div>
</div>
<div id="losers" class="widget">
<label class="hidden">Losers</label>
<div id="losers-table"> </div>
</div>
</div>
</div>
</body>
</html>