I've got the script below
window.addEventListener('DOMContentLoaded', (event) => {
document.querySelectorAll("a[href='example.com']").addEventListener('click',function (e) {
newrelic.addPageAction('Doc');
})
});
I am trying to capture count of hits whenever the user opens the document enclosed within anchor tag with href present but no ID property. The document opens in another window. Is the above correct way to use.