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>
<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> ….. </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>