# Warning in Google Pagespeed Insights about Piwik code?

**URL:** <https://community.piwik.pro/t/warning-in-google-pagespeed-insights-about-piwik-code/1793>\
**Category:** Data collection and tags\
**Created:** [March 13, 2023, 3:21pm UTC](https://community.piwik.pro/t/warning-in-google-pagespeed-insights-about-piwik-code/1793 "2023-03-13T15:21:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![optipiwik](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/optipiwik/32/806_2.png) [@optipiwik](https://community.piwik.pro/u/optipiwik)\
**Post date:** [March 13, 2023, 3:21pm UTC](https://community.piwik.pro/t/warning-in-google-pagespeed-insights-about-piwik-code/1793/1 "2023-03-13T15:21:40Z")

</div>

When I run a website with PiwikPro installed in Google Pagespeed Insights I get this warning about the Javascript related to PiwikPro:

> Blockquote  
> “Avoid serving legacy JavaScript to modern browsers”  
> Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren’t necessary for modern browsers. For your bundled JavaScript, adopt a modern script deployment strategy using module/nomodule feature detection to reduce the amount of code shipped to modern browsers, while retaining support for legacy browsers.

[/17672c94-….js?data\_layer\_name=dataPiPrLayer](https://option-webdesign.containers.piwik.pro/17672c94-5b6e-4baa-9811-4905d8340406.js?data_layer_name=dataPiPrLayer)

(option-webdesign.containers.piwik.pro) 6.9 KiB  
[/17672c94-….js?data\_layer\_name=dataPiPrLayer:5:10094](https://option-webdesign.containers.piwik.pro/17672c94-5b6e-4baa-9811-4905d8340406.js?data_layer_name=dataPiPrLayer)

(option-webdesign.containers.piwik.pro) Array.prototype.filter  
[/17672c94-….js?data\_layer\_name=dataPiPrLayer:5:13941](https://option-webdesign.containers.piwik.pro/17672c94-5b6e-4baa-9811-4905d8340406.js?data_layer_name=dataPiPrLayer)

(option-webdesign.containers.piwik.pro) Date.now  
[/17672c94-….js?data\_layer\_name=dataPiPrLayer:5:14550](https://option-webdesign.containers.piwik.pro/17672c94-5b6e-4baa-9811-4905d8340406.js?data_layer_name=dataPiPrLayer)

(option-webdesign.containers.piwik.pro) Array.prototype.forEach  
[/17672c94-….js?data\_layer\_name=dataPiPrLayer:8:2672](https://option-webdesign.containers.piwik.pro/17672c94-5b6e-4baa-9811-4905d8340406.js?data_layer_name=dataPiPrLayer)

(option-webdesign.containers.piwik.pro) @babel/plugin-transform-classes

So my question, is this something to worry about, something wrong or out-of-dfate with the Piwik code (installed with the WordPress plugin)?

Thanks for the help,  
Alwin

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [March 13, 2023, 8:40pm UTC](https://community.piwik.pro/t/warning-in-google-pagespeed-insights-about-piwik-code/1793/2 "2023-03-13T20:40:19Z")

</div>

Hi. I’ll double-check with the team, but most likely it’s because our tracking library has to be compatible also with older browsers. We cannot control what devices and browsers are used by website visitors.

**Update:** Indeed, it’s for BC. We might consider dropping support for some browsers to get rid of that code.

---

<div class="post-metadata">

**Author:** ![optipiwik](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/optipiwik/32/806_2.png) [@optipiwik](https://community.piwik.pro/u/optipiwik)\
**Post date:** [March 16, 2023, 9:26am UTC](https://community.piwik.pro/t/warning-in-google-pagespeed-insights-about-piwik-code/1793/3 "2023-03-16T09:26:29Z")

</div>

Thank you for the update kuba 🙂
