Offline Google Analytics for PWA

I tried to follow the official tutorial at for my Angular App.

But, the document looks like old. Because when I installed sw-offline-google-analytics by npm. There was not offline-google-analytics-import.js in node_modules.

So I copied the in node_modules to my src directory. And I did what I can everything as much as I understood like below. There was any compile errors. But when I tested like, it doesn’t work.

[In app.module.ts]

imports: [

ServiceWorkerModule.register(‘combined-sw.js’, { enabled: environment.production })


[In combined-sw.js]





[In angular.json]

“assets”: [



Could you help me to solve this issue? I cannot find any hints in googling.

Thanks in advance