Interactive Web Analytics Reporting Dashboard for Enterprise Businesses
Total Page:16
File Type:pdf, Size:1020Kb
Interactive Web Analytics Reporting Dashboard for Enterprise Businesses. Integrating Google’s Web tools for a one-stop reporting interface Apostolos Gouvalas SID: 3306160002 SCHOOL OF SCIENCE & TECHNOLOGY A thesis submitted for the degree of Master of Science (MSc) in Mobile and Web Computing DECEMBER 2017 THESSALONIKI – GREECE Interactive Web Analytics Reporting Dashboard for Enterprise Businesses. Integrating Google’s Web tools for a one-stop reporting interface Apostolos Gouvalas SID: 3306160002 Supervisor: Dr. Christos Berberidis SCHOOL OF SCIENCE & TECHNOLOGY A thesis submitted for the degree of Master of Science (MSc) in Mobile and Web Computing DECEMBER 2017 THESSALONIKI – GREECE Abstract The aim of this dissertation was to develop, using cutting-edge technologies, a visual analytics dashboard for enterprise businesses, utilizing the Analytics and Real Time Re- porting APIs from Google APIs. Moreover, we had to present the data from all web prop- erties of a user’s Google Analytics account in order to give them a better overview across all their tracking properties, while maintaining a user-friendly environment. Apostolos Gouvalas 18 Dec 2017 -i- Acknowledgements I would like first to thank my dissertation supervisor Dr. Christos Berberidis of School of Science at International Hellenic University for providing guidance when needed. I would also like to thank the collaborative company, iTrust, for providing the thesis subject and specially their lead developer Mpampis Sykovaridis for guiding me regard- ing the technologies I utilized in the development process and for giving me constructive feedback when I present them the final product. Next, I would like to thank my parents for supporting me both financially and emo- tionally with my decision to study at this master and throughout my life in general. Last but not least, I would not have achieved any of this without my girlfriend Chrysa, who was supporting and encouraging me from the very beginning and throughout the year in order to overcome any obstacles. -ii- Contents ABSTRACT .......................................................................................................................................... I ACKNOWLEDGEMENTS .................................................................................................................. II CONTENTS ........................................................................................................................................ III 1 INTRODUCTION ........................................................................................................................ 1 1.1 THE PROBLEM ............................................................................................................................... 2 1.2 SOLUTION ...................................................................................................................................... 2 1.3 OVERVIEW OF NEXT CHAPTERS ................................................................................................... 3 2 LITERATURE REVIEW ............................................................................................................. 5 3 UTILIZED TECHNOLOGIES .................................................................................................... 9 3.1 BACK-END .................................................................................................................................... 10 3.1.1 Node.js .............................................................................................................................. 10 3.1.2 npm & Yarn ...................................................................................................................... 11 3.1.3 Express.js ......................................................................................................................... 12 3.1.4 Passport.js ........................................................................................................................ 12 3.1.5 Mongoose.js ..................................................................................................................... 12 3.1.6 Socket.io ........................................................................................................................... 13 3.1.7 Googleapis ....................................................................................................................... 13 3.1.8 Request ............................................................................................................................. 13 3.1.9 Express-session .............................................................................................................. 13 3.1.10 Lodash .......................................................................................................................... 13 3.1.11 Morgan ......................................................................................................................... 13 3.1.12 Concurrently ................................................................................................................ 14 3.2 FRONT-END ................................................................................................................................. 14 3.2.1 React ................................................................................................................................. 14 3.2.2 React Router .................................................................................................................... 15 3.2.3 Redux ................................................................................................................................ 15 3.2.4 React-sparklines .............................................................................................................. 15 3.2.5 Redux-form ....................................................................................................................... 15 3.2.6 Moment.js ......................................................................................................................... 15 3.2.7 React-widgets .................................................................................................................. 15 -iii- 3.2.8 MaterializeCSS ................................................................................................................ 16 3.2.9 Font Awesome ................................................................................................................. 16 3.2.10 Particle.js – React Component ................................................................................. 16 4 IMPLEMENTATION ................................................................................................................ 17 4.1 ARCHITECTURE HIGH-LEVEL OVERVIEW ..................................................................................... 17 4.2 ITRALYTICS BACK-END ................................................................................................................ 18 4.2.1 Authentication Related Route Handlers ....................................................................... 18 4.2.2 Google Analytics Related Route Handlers .................................................................. 22 4.2.2.1 requireLogin Middleware ..................................................................................................... 23 4.2.2.2 validateAccessToken Middleware ...................................................................................... 23 4.2.2.3 refreshAccessToken Middleware ....................................................................................... 24 4.2.2.4 GET /api/analytics/accountSummary ................................................................................. 25 4.2.2.5 GET /api/analytics/reportsBatchGet ................................................................................... 27 4.2.3 Socket.io & Google Analytics Real Time Reporting API ............................................ 28 4.3 ITRALYTICS FRONT-END ............................................................................................................. 30 4.3.1 Initial crate-react-app setup ........................................................................................... 31 4.3.2 Single Page Application .................................................................................................. 34 4.3.3 Connection to our API & displays .................................................................................. 36 4.3.3.1 Log-in ...................................................................................................................................... 36 4.3.3.2 Fetching User’s Google Analytics Web Properties .......................................................... 37 4.3.3.3 Initialize ChartsList Component .......................................................................................... 40 4.3.3.4 Display Analytics for All User’s Web Properties ............................................................... 40 4.3.3.5 Get Real-time Analytics data ............................................................................................... 41 5 FUTURE WORK ...................................................................................................................... 45 6 CONCLUSIONS ....................................................................................................................... 47 BIBLIOGRAPHY ..............................................................................................................................