I-Google PageSpeed ​​Insights vs. I-Google Analytics

Amathuluzi okuqinisekisa afana ne- W3C Markup Validation Service noma i- Google PageSpeed ​​Insights ayasiza ekuhloleni kahle ikhodi nokusebenza kwewebhusayithi. I-Google ithonya ikakhulukazi imboni yonke enemiqondo efana ngenhla kwesibaya - futhi iphinda inikeze imihlahlandlela eqinile kepha ewusizo yokucinana kwesithombe nokulondolozwa kwesikhashana. Noma kunjalo, kungenzeka ukuthi i-Google izinyathele ngezinyawo zayo.


Ingabe ikhodi yokulandela iJavaScript

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12350231-1', 'auto');
  ga('send', 'pageview');

Ihlanganiswe yiGoogle Analytics kuwebhusayithi njengoba kuchazwe ngokusemthethweni , uGoogle ukhononda ngokungabi bikho kwesilondolozi sesiphequluli:

I-Google PageSpeed ​​Insights vs. I-Google Analytics

Ngeshwa, ngobuchwepheshe lokhu kungalungiswa kuphela ngumgcini wefayela, kulokhu iGoogle uqobo, futhi kungenzeka ukuyilungisa ngokusebenza okulandelayo: Okokuqala ugoba i-URL

(window,document,'script','//www.google-analytics.com/analytics.js','ga');

kuseva yakho

(window,document,'script','analytics.js','ga');

futhi ibeka umsebenzi olula we-cron nge-PHP, elanda ifayili lakamuva le-.js lisanda kuseva yayo nsuku zonke:

file_put_contents("analytics.js", fopen("https://www.google-analytics.com/analytics.js", 'r'));

Ngemuva kwalokho ungashuna kahle ukulondolozwa kwesikhashana ukuze iPageSpeed ​​ingabe isaligxeka iphutha:

I-Google PageSpeed ​​Insights vs. I-Google Analytics

Emuva