sathoro
Forum Replies Created
-
Forum: Reviews
In reply to: [Breeze - WordPress Cache Plugin] Breaks several things@adeelkhan Yes in the admin interface there were Javascript errors due to the responses being malformed. It said “The response is not a valid JSON response.” because it was being returned as text/html and the response was wrapped in HTML tags due to Breeze messing with the API response for some reason. I tested this on a brand new WordPress installation. It broke some functionality in the Gutenberg editor mostly. You can test it by creating a user with the Editor role, logging in as them, and doing some actions in Gutenberg editor.
For the problem I mentioned where it was removing the analytics script there was no console error, it just removed the script entirely.
Thanks @mlchaves! That is very helpful
Hey @mlchaves, I came across this thread because I noticed the gtag script is in the head and doesn’t have the async or defer attributes. This means the website will be blocked from being rendered until the script is fully executed. This can of course cause significant delay since it will generally require a DNS request, SSL handshake, JS execution etc etc. Of course most the time it is quick but if there is any slowdown well it will make the whole site seem slow.
You mentioned the docs say defer is not recommended, but I noticed that on this page https://developers.google.com/analytics/devguides/collection/gtagjs the code example actually uses the async attribute. This seems to me that Google in fact does recommend using async, but I have not done significant research on this. I did check a couple of Google-owned properties and they all used the async property on their own gtag scripts.
So I’m wondering if there is an option or workaround for adding the async attribute to the script? Thanks!
Btw, I do understand that this will can cause some page views to not get counted but I would prefer that over the page from being blocked from rendering. Also since some people use ad blockers you can’t really rely on GA being 100% accurate anyways so some missed hits isn’t critical.