Thanks for using Announcer.
In that case you can simply create a
<script> tag and add your JS under that.
You can target the “primary” button with the below selector.
var announcement_btn = document.querySelector('#ancr-471 .ancr-btn-primary');
Replace 471 with your announcement ID and in my code use to triggger whatever needed.