Implementing an effective and relevant e-commerce strategy means first and foremost measuring and studying statistical data on traffic and engagement on your site. Although PrestaShop provides some interesting e-business KPIs, the ideal solution is to supplement this information by installing the Google Analytics tool.

At present, there are 3 ways to get your PrestaShop data into your Google Analytics account, which we'll explain in this article.

Where can I find my Google Analytics 4 code?

Before you start, you need to be able to identify your code (ID or js script) to validate the next steps in the parameterization process.

Google Analytics 4 Code

Log in to your Google Analytics 4 account, then click on "Administration" then "Data feeds". Then click on your feed and on the first line you'll find your GA4 measurement ID.

Prestashop Google Universal Analytics or GA4 module

Numerous modules are available on thePrestashop addons and are used to facilitate the installation of the Google Analytics script. Using these modules, all you have to do is enter your ID and your script will be automatically implemented.

To add the module, go to your Prestashop storethen click on the "module" menu, "module manager", then "install a module".

However, it's important to note that this type of module severely limits the possibilities of implementing advanced tracking, particularly where e-commerce data is concerned (tracking sales, additions to the shopping cart, or the purchase tunnel are not data that can be tracked). Only "basic" data (users, sessions, traffic sources...) will be tracked.

➤ Advantage: Quick installation

➤ Disadvantage : Limited e-commerce tracking settings

Google Analytics screenshot - seo expertise webmarketing agency

Prestashop Google Tag Manager module

We strongly recommend this method for implementing Google Analytics tracking and, if possible, the use of a Google Analytics module. GTM e-commerce advancedmodule, which will inject data layers adapted to e-commerce tracking. You'll first need to download and install the module, then create a Google Tag Manager account. Using GTM will give you greater tracking flexibility, and you'll be able to quickly and easily customize specific events to track (newsletter sign-up, quote request, phone number click, etc.).

Code GA4 in GTM

Don't forget to publish your tags to Google Tag manager, otherwise no data will appear in Google Analytics.

Old-fashioned gtag.js installation

This method involves entering the Java Script directly into the Prestashop source files. We do not recommend this method, as it can have undesirable effects, and requires the intervention of a developer and access to the server. In fact, touching PrestaShop's core files should be avoided wherever possible.

However, if you want to use this method, you first need to find the right template to edit, the one in which the head tag is located, and then add a new block with your script to the head.tpl.

screenshot html code - seo expertise webmarketing agencyscreenshot code - - seo expertise webmarketing agency

➤ Advantage : None

➤ Disadvantage: Risk of side effects

 

Check that data is correctly reported

Google Analytics 4

If you've followed all the above instructions correctly, you should start to see traffic flowing into your Google Analytics account. On GA4, go to the "Report" > "Real Time" menu. You'll see active users on your website for the last 30 minutes and pages viewed. Another way to check that your website is reporting correctly is to use the DebugView ("Configure" menu > "Debugview"). This allows you to view a device's debugging events in real time. To see the events appear, you can use the "Preview" tool in Google Tag Manager or download the Chrome extension. Google Analytics Debugger. Debugview is only available on GA4.

prestashop site speed test with gtmetrix - agence Prestashop

Are the 2 scripts compatible?

Of course, the 2 scripts are perfectly compatible. You can install several Universal Analytics and GA4 scripts on the same website. However, for more advanced Prestashop e-commerce tracking, you'll also need to implement a dataLayer on your website (we recommend implementing a dataLayer for GA4, not Universal Analytics). If you use the GTM enhanced e-commerce module, you'll be able to choose between a UA or GA4 dataLayer, but not both at the same time. Please note that the configuration of your Google Tag Manager account will vary according to the dataLayer you choose.

A quick recap!

Conclusion

We've just listed the different ways to install Google Analytics script on your Prestashop site, and Google Tag Manager is without doubt the best way to track your data over the long term. If you need any help with the settings, or simply have any questions about how a module works, don't hesitate to get in touch with our webmarketing experts.