Why is Yandex Metrica making so many API calls?

I have a SPA running on Nextjs and inside it renders an iframe widget built with React.

Inside that widget, in the index.html file, I’ve placed the Yandex Metrica script.
Then, I set up a goal tag to listen on a JavaScript event (when user clicks on registration button).

The goal is working as expected and does register whenever the button is clicked.

However, I’m seeing a whole bunch of network calls going out to yandex metrica and I can’t figure out why. Also, it appears anytime an event listener is triggered so is the main Yandex script.

Source: Ask Javascript Questions

LEAVE A COMMENT