Analytics Cache

Hi
I did a Pagespeedtest with Google and it suggest me to set the Google Analytics Cache to 2 hours.
On my Website i use sh404sef for the implementation.
Is there a way to set this suggestion to fulfill more Google guidelines.
Maybe if the option is not implemented yet could this come in a future update?
Thanks a lot for your help.
Responses (3)
  • Accepted Answer

    Monday, November 05 2018, 06:17 PM - #Permalink
    Hi

    Well, that file is coming from the Google servers so you'll have to ask Google to add caching to it :)

    And yes, it's interesting to see the Google/Analytics does not follow the guidelines in Google/PageSpeed. But it's a good illustration of the fact Google PageSpeed is only providing that, guidelines, and each proposal they made has to be evaluated carefully in each case. Some suggestions may actually be negative in some situations.

    Best regards
    The reply is currently minimized Show
  • Accepted Answer

    Monday, November 05 2018, 08:23 PM - #Permalink
    Ok Thanks for your information. It really seems strange why Google then suggest that if they dont hold on their own hosted cache guidline haha

    But anyway i also searched a little and found this Infopage for an other solution which would be a great alternative (or lets say maybe an extra way you could implement in a future update to integrate as an alternative for users who dont want the original Google Analytics)
    https://github.com/jehna/ga-lite

    I would love to change the option for a few facts. Because its smaller, users can decline in browser with the dont track flag and most of the features are available and its cacheable)
    So maybe it is another great option for a next update :)
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 07 2018, 10:34 AM - #Permalink
    Hi

    Well, again, this is one of those situations where recommendations from Google Page speed should be taken with a grain of salt. The 2 caching time is fine to be honest, it allows frequent updates from the script with very good caching. It means the script will be actually downloaded only every 2 hours so it will affect only a very small number of URLs and really is not something that will affect user experience.

    On the other hand, scripts similar to the one you linked to - it's not complex, we even have one of our own for some internal servers - appears like a good idea but may not always be. Issues are:

    - missing features and reliance on 3rd party fro bug fixes and new features - Client ID api for instance
    - the script will be downloaded from the user server, which will always be much slower than Google's
    - more importantly, for most pages of most sites, there will be no download at all because the Analytics script is the same for every one and most sites have it. So even when you come to a site for the first time, the Analytics script is already there, from another site and does not need to be downloaded.

    When using a 3rd party script, then it will have to be downloaded separately for each site which is a net loss.

    I have looked at this in the past a few times but the conclusion is always the same, pros and cons are in favor of using the original script.

    What would be a real change is to use something like Matomo (ex-Piwik), but that's a totally different thing of course.

    Best regards
    The reply is currently minimized Show
Your Reply