I would like to know when the Matomo script cannot be loaded and may be ad-blocked.
My use case is that I do AB tests using the Matomo plugin and I need to detect when to use a fallback if the script does not load.
Of course I don't want to run a setTimeout manually and would like to rely on events instead. :grin:
I already use the matomoAbTestingAsyncInit callback to know when I can use Matomo but I have nothing yet to be notified when It was blocked.
I did a POC by adding an onerror listener on the scriptElement to be inserted. It seems to be working as I expect. May I open a PR?
Hey :wave:
I would like to know when the Matomo script cannot be loaded and may be ad-blocked. My use case is that I do AB tests using the Matomo plugin and I need to detect when to use a fallback if the script does not load. Of course I don't want to run a setTimeout manually and would like to rely on events instead. :grin: I already use the
matomoAbTestingAsyncInit
callback to know when I can use Matomo but I have nothing yet to be notified when It was blocked.I did a POC by adding an
onerror
listener on the scriptElement to be inserted. It seems to be working as I expect. May I open a PR?