Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/remove-async: removed async from script #11

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aleksandragrodem
Copy link
Contributor

Met.no got errors because of _paq.push() got executed after the script was run. So other scripts was downloaded and run async a bit too fast. This was solved by removing the async from the script.

Roeland, feel free to correct me if the explanation is a bit off.

@Roeland-Bouvet
Copy link

Yeah, that's basically it. :)

The first matomo.js (+ hash) script is supposed to prepare some configuration for when the actual matomo.js script is loaded and executed. But because both script tags were set to be async, and the first one to finish loading would execute first, the "configuration script" would sometimes be executed too late. With only defer, and keeping the correct order in the head, we can make sure that the scripts get executed in the right order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants