-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
JavaScript tracker code should be added immediately before the closing </head> section #9341
Comments
The logic for suggesting to add code after the |
I think this topic is really important! If piwik is loaded late -after most of the visible content-and it is blocked in a bad way, the website still looks mostly fine. |
just a feedback: This is how to looks: <!-- START PIWIK TRACKING CODE -->
<script type="text/javascript">
//<![CDATA[
...
<!-- END PIWIK TRACKING CODE -->
</div>
</div>
</body>
</html> |
@op: This suggestion leads to having the fallback code ( |
So, why was this done? I thought that webperf dictated to include all scripts as late as possible in the page, and especially the non-critical ones. Analytics is clearly the least to me. Why should I block rendering by adding Piwik in |
Include analytics at end of page Remove tooling-dependent inclusion system This goes against Piwik recommendation. See discussion at matomo-org/matomo#9341.
Include analytics at end of page Remove tooling-dependent inclusion system This goes against Piwik recommendation. See discussion at matomo-org/matomo#9341.
Include analytics at end of page Remove tooling-dependent inclusion system This goes against Piwik recommendation. See discussion at matomo-org/matomo#9341.
This issue is about improving our documentation: sometimes we recommend to add the tracking code before
</body>
and sometimes after<body>
.Actually it is recommended to include the tracking code in the
<head>
section or after the opening<body>
tag.Guides to fix:
The text was updated successfully, but these errors were encountered: