Better Google Analytics Speed Tracking in PrestaShop

Page speed is becoming a very important aspect of e-commerce now. If your site is too slow for your users, they will abandon your site and do their shopping elsewhere. But how do you measure your page speed reliably? Out of the box PrestaShop’s Google Analytics module only measures 5% of your users.

 

Lets Fix PrestaShop’s Google Analytics

With only 5% of your visitors being measured your site speed readings can be heavily skewed. This gets even more skewed when you take into account that you might be only measuring one user in a country. To even this out and get a better picture of how your site is performing you can up the measurement rate to 100% of your users. This reading does cap off at 100,000 users per day though.

 

To change the file you will need to FTP into your PrestaShop store. Once you are in your PrestaShop store, you will need to locate the file modules/ganalytics/views/templates/hook/header.tpl This is the file that you will need to edit. You can see where it is located in the image below.

PrestaShop Google Analytics

 

Once you have the file open, you will want to look around line 98 depending on the version of the module you are using. It should look like the image below.

PrestaShop Analytics Speed Setting

 

What you are wanting to edit is the _siteSpeedSampleRate. Instead of measuring 5% you want it to measure 100%. So you will need to replace the 5 with 100. Then all you have to do is save the file and upload it to your server. It should automatically start working once it is uploaded.

 

Conclusion

Once you have saved the file and uploaded it to your server, give your site several days to start evening out the site speed information in Google Analytics. Polling everyone will give you a better picture of how your site is performing in countries that you still get very little traffic in. This is generally a change we make to most of our clients shops so that they can have a true picture of the speed of their site without having one or two bad users taint the view that they see. This is especially important now that many people use mobile devices. The reason being is what looks like a slow page load can actually be the users mobile device network loading slow because of traffic.

About the Author: Lesley Paone

Lesley has worked in e-commerce for over a decade, and is the founder of dh42. Starting out with PrestaShop and brancing out into other platforms like Shopify. He loves all things e-commerce and loves a challenge, in his spare time he helps moderate several forums on SEO, e-commerce, as well as the PrestaShop forum. If you have any questions for him about any of his articles just use our contact form to contact him.

Share: