Google Analytics & LiteSpeed Cache




Wordpress LScache Plugin: Google Analytics & LiteSpeed Cache

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi, I have a LiteSpeed Cache on my website (settings based on https://websiteedu.com/litespeed-cache-settings/). Everything is perfect, with one exception ? my Google Analytics doesnt work at all. Yesterday, I added tracking code to section. Just to be sure that everything is ok with it. I saw data in real time, after a while it stopped working and I dont see that data today in my reports. I disabled LiteSpeed Cache and now everything works fine. I want to use LiteSpeed Cache but I need data from GA? What should I do? Could you please help me with that? The page I need help with: https://marketinghacker.pl Hi, Could you please provide the report number ? Best regards, Hi, Report number ? DXZLQYIP. Hi, Could you please activate LSCWP for moment ? I need to see the generated HTML code Best regards, Hi, I turned it on. Hi, With LSCWP window.dataLayer = window.dataLayer || [] function gtag() dataLayer.push(arguments) gtag(js, new Date()) gtag(config, UA-65607291-5) window.dataLayer = window.dataLayer || [] function gtag() dataLayer.push(arguments) gtag(js, new Date()) gtag(config, UA-158623761-1) without window.dataLayer = window.dataLayer || [] function gtag() dataLayer.push(arguments) gtag(js, new Date()) gtag(config, UA-65607291-5) window.dataLayer = window.dataLayer || [] function gtag() dataLayer.push(arguments) gtag(js, new Date()) gtag(config, UA-158623761-1) Expand the code is identical , I dont see any reason why it went wrong. Could you please try reset LSCWP to default setting and see how it goes ? Best regards, Hi, Well, I think that it is more complicated When I noticed that problem with GA, I added tracking code to header.php (previously, it was implemented by plugin Header and Footer Scripts). It worked and I could see real-time data in GA. I checked GA next day (around 9 AM) and it wasnt working at all. 24 hours have passed and I still dont see data from that day in GA. Website changes a bit ? small window with Facebook wasnt visible and that strap at the bottom of the page (cookies policy) changes colors to basic version. I used Google Analytics Debugger to check if there was something wrong with GA script and everything was ok. I switched off two options in LSCWP (I found some recommendations on forum): ? JS Combine ([5] ? OPTIMIZE), ? Instant Click ([A] ? ADVANCED). But it didnt worked. I couldnt find any better solution so I asked here for help and switched off LSCWP. Currently, I see data in real-time and website looks normal. Do you think that turning it off and on again helped? I hope that it stays that way. But Im not sure after my previous experiences :/ With default settings everything was fine for very long time. If tommorow I wont see data in GA, I will switch to default settings. Before that, should I let you know that there is a problem again? I really appreciate your help on this! Thank you! The good old turn off and on again worked Thank you again!



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference