-
-
Notifications
You must be signed in to change notification settings - Fork 213
Move analytics templates to head section #8182
Comments
|
So they suggest to move all scripts but their own to the end of the page? Why? |
|
Because they can’t track you if the page is not fully loaded otherwise. If it’s at the top you’re more likely to track every visitor. Invalid argument to me :D |
|
Google Analytics gets loaded asynchronously. Or use: They both do exactly the same. If you load you CSS async as well, it does not matter where Google Analytics is included. |
Moving the script to the
So the CSS files are included before the script anyway. |
|
Can we add a checkbox in page layout for Google Analytics script to arrange it self? Checked: [X] Show before the closing head-tag Also the Google Tag Assistent extension say "Code found outside of head-tag" . |
|
I think we should decide for one best practice. Other solutions can then be done by putting the code into |
|
As discussed in Mumble on July 21st, we will move the |
|
Changed in contao/core-bundle@e7a0a7e. |
|
I know this issue is closed, but I think this post should be added here. Fügen Sie diesen Code so weit oben wie möglich im head-Tag der Seite ein. Fügen Sie diesen Code außerdem direkt nach dem eröffnenden body-Tag ein: |
Google has criticised some of our websites regarding the position of the Google Analytics tracking code within the source code.
According to their guidelines, one should always position the script block within the
<head>section of the page and not at the very end.I have no idea whether they changed that just recently or whether one should have done it like that all the time, but there it is.
Question is now: Should Contao change its behaviour to reflect Google's guidelines?
The text was updated successfully, but these errors were encountered: