Defining event listeners

Event listeners should be defined after the Continually embed script is declared.

Example - event listeners defined in head

<head>
   <script>var continuallySettings = { appID: "463eykw6ynvj" };</script>
   <script src="https://cdn-app.continual.ly/js/embed/continually-embed.latest.min.js"></script>
   <script>
      continually.on('emailCapture', function(event){
        console.log(event);
           console.log('emailCapture');
      });
   </script> 
..... 
</head>
Example - event listeners defined in body
<body>
........
   <script>var continuallySettings = { appID: "463eykw6ynvj" };</script>
   <script src="https://cdn-app.continual.ly/js/embed/continually-embed.latest.min.js"></script>
   <script>
      continually.on('emailCapture', function(event){
        console.log(event);
           console.log('emailCapture');
      });
   </script>
 &hellip;.. </body>

Example - code will not execute ⚠️

<body>
 ........
   <script>
      continually.on('emailCapture', function(event){
        console.log(event);
           console.log('emailCapture');
      });
   </script>
    <script>var continuallySettings = { appID: "463eykw6ynvj" };</script>
   <script src="https://cdn-app.continual.ly/js/embed/continually-embed.latest.min.js"></script>
 .....
 </body>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.