• Resolved LBandy

    (@lbandy)


    Hi Thomas,

    Greetings from your homeland, and a thanks a lot for this awesome plugin!

    I recently investigated the options to speed up my website and one way to further increase speed is by self-hosting analytics code. It works well with normal Google analytics but not with the GTM plugin. Do you think it’d be possible to add a local cache of the containers and serve that instead of getting it fresh from Google every time?

    Thanks again,
    Andras

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Szia András ??

    My point of view regarding this topic is that if you have optimized everything else on your website, this one should not harm a lot.

    Short answer: as far as I know it is not possible with GTM (so not with this plugin but with GTM itself)

    Tools like Page Speed Insights and GMetrix usually complain about analytics.js and gtm.js for being either slow or using not optimized cache parameters. But in most cases this is a false positive IMHO.

    analytics.js is sometimes updated without further notifications to the public. Any local serving would not immediately see this and break your metrics for some minutes or even for some hours.

    Also, for most of your site visitors, analytics.js is already in the browser cache as many websites are using it and all websites are loading it from google-analytics.com
    GMetrix and other speed testing tools do not take into account this behavior. But the worst case scenario is that your site will load analytics.js on the first page load and any subsequent page load will use the browser cache. I am not sure this is something that make lots of issues regarding website performance.

    Thread Starter LBandy

    (@lbandy)

    Thanks a lot for your reply, it makes perfect sense! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is self-hosting GTM possible?’ is closed to new replies.