Guest User

Untitled

a guest
Sep 13th, 2019
118
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2.  
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6.  
  7. <title>view clickstream</title>
  8. <meta name="description" content="view clickstream">
  9. <meta name="author" content="str8up.media">
  10.  
  11. <script
  12. src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  13.  
  14.  
  15. <link
  16. rel="stylesheet"
  17. href="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/style.css"
  18. />
  19. <script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/index.js"></script>
  20.  
  21. </head>
  22.  
  23. <body>
  24. test21
  25. <div id="streamshower"></div>
  26.  
  27. <script>
  28.  
  29. class ClickStreamEvent {
  30. constructor(type, data, timestamp) {
  31. this.type = type;
  32. this.data = data;
  33. this.timestamp = timestamp;
  34. }
  35. }
  36.  
  37. $.getJSON( "/api/getclickstream?uuid={{ ouruid }}", function( data ) {
  38. var session_events = data['session_events'];
  39.  
  40. const events = [];
  41.  
  42. $.each(session_events, function(n, session_event) {
  43.  
  44. var ourtype = session_event['type'];
  45. var ourdata = session_event['data'];
  46. var ourtimestamp = session_event['timestamp'];
  47.  
  48. myobj = new ClickStreamEvent(ourtype,ourdata,ourtimestamp);
  49.  
  50.  
  51. events.push(myobj);
  52. });
  53.  
  54.  
  55.  
  56. new rrwebPlayer({
  57. target: document.getElementById("streamshower"), // customizable root element
  58. data: {
  59. events,
  60. autoPlay: true,
  61. showDebug: true,
  62. showWarning: true
  63. },
  64. });
  65.  
  66. });
  67.  
  68.  
  69.  
  70. </script>
  71.  
  72. </body>
  73. </html>
RAW Paste Data