_paq.push() was used but Piwik tracker was not initialized before the piwik.js

We are using the following script to track events on Matomo 3.0.4

However, we receive errors as follows in the browser’s console, although the activity is recorded properly.

“_paq.push() was used but Piwik tracker was not initialized before the piwik.js file was loaded.”

Any ideas?