Hello,
When I run my site in Google Pagespeed Insights (GPI), I get the following notification (image attached) saying basically that loading the GA script from outside my site, actually slows it down a bit.
Seemingly, it gives a slightly lower GPI grade, and I would want to have these extra GPI points.
After reading about it in a quick search, it seems as a quite known issue that has been solved for WordPress but I don't know of a contributed solution for Drupal.
Given I am not a JS programmer, and just study basic PHP, I humbly ask to know if there is a way, or if you might be considering adding a way, to download and load the GA code daily & locally on a Drupal site, as a Cron task?
Thank you,
Comment | File | Size | Author |
---|---|---|---|
#6 | Options.JPG | 43.24 KB | Benia |
GPI-suggestion.JPG | 33.2 KB | Benia |
Comments
Comment #2
Benia CreditAttribution: Benia commentedComment #3
Benia CreditAttribution: Benia commentedComment #4
hass CreditAttribution: hass commentedLooks like you are not using this module. Why are you opening cases than?
Comment #5
Benia CreditAttribution: Benia commentedOf course I use it, I just didn't find data on the option I needed to check in a Google search but gladly there is now a particular explanation for all newcomers about this in Stackexchange.
http://drupal.stackexchange.com/questions/212860/downloading-and-loading...
Comment #6
Benia CreditAttribution: Benia commentedHello Alex,
I went to admin/config/system/google-analytics#edit-advanced and there checked: "Locally cache tracking code file".
I then ran Cron, flushed all caches both in Drupal (drush cr) and in server: Google PageSpeed / Cloudflare, and yet no change was seen.
I thought I should wait a day or so, so the new script will be downloaded but sadly after 2 days no change is seen --- When I run a GPI test, I still see the same issue regarding the GA script.
* I am just learning some basic PHP so can't debug in an IDE.
* No errors in drush ws --full.
Would appricate your help.
Comment #7
hass CreditAttribution: hass commentedI see it is working
and there is also a test for local caching that does not fail.
You need to find the root cause on your system. If it is a bug in the modules we can fix it.
Comment #8
Benia CreditAttribution: Benia commentedI still have this problem even after moving from shared hosting to VPS so performance not seem to bias (if it can, I don't know).
I have no errors in status report nor in drush ws --full ... Can you give me a direction what should I check?
Thank you Alex,
Comment #9
Benia CreditAttribution: Benia commentedMight it be that I actually need to download the script to a file from here and put it somewhere?
(I theorized that when I check the option but there is no file locally to be cached, it will load it from the web and I won't have the effect).
Comment #10
hass CreditAttribution: hass commentedNo, you do not need to download anything. Disable local caching.
Comment #11
Benia CreditAttribution: Benia commentedDo you mean to Page cache maximum age, under admin/config/development/performance? It is disabled for 2 years already...