Hyperlink to markers on map

Perhaps some more helpful details. Hereโ€™s the script tag injected into the html:

<script type="text/javascript">

    
    var plot_element = document.getElementById('3f56277f-e84b-4b68-ae85-91d3cd62d01c');
    console.log('callback js has been added to page. did we get plot_element?');
    console.log(plot_element);
    
    plot_element.on('plotly_click', function(data){
        console.log('Im inside the plotly_click!!');
        console.log(data);
        var point = data.points[0];
        if (point) {
            console.log(point.customdata);
            window.open(point.customdata);
        }
    })
    
</script>

The first two console logs before the event listener succeed, but when I click on points in my scatter plot the event never seems to fire.