Stape
Search
Try for free

PrestaShop module for server Google Tag Manager

Updated
Oct 18, 2024
Published
Oct 9, 2024

PrestaShop has gained popularity due to its high flexibility and customization when creating an online store. If you are looking for a solution to set up server-side tracking for your website, consider a solution developed by Stape - PrestaShop module for server GTM.

In this article, we will review the solution, describe its benefits, explain how to set it up, and how to test the module configuration.

Advantages of PrestaShop module for server GTM

PrestaShop module was primarily created for server-side tracking; however, it also adds a web GTM snippet to every page of your online store automatically.

As for server-side users, you will get the following benefits of using PrestaShop module:

  • Make tracking scripts (GTM, Google Analytics snippets) resistant to ad blockers.
  • Enrich the dataLayer with product and user data.
  • Send webhooks to server GTM.

Why choose Stape server-side tracking for PrestaShop module

Besides the benefits above, if you are registered as a Stape user you can also use Cookie Keeper, which helps avoid browser restrictions (such as Safari ITP) and prolong cookies’ lifetime.

Also, you can use numerous free power-ups developed by Stape. The power-ups help make the server-side experience as smooth as possible. Among the popular ones are:

  • Custom GTM and GA4 Loader - make GTM and GA4 scripts more resistant to ad blockers.
  • Anonymizer - remove or anonymize user data from GA4.
  • Stape Store - built-in database that enables you to write, read, and sync data within the server-side Google Tag Manager.

How to set up the PrestaShop module for server GTM

1. Set up server GTM container and host it on Stape.

2. To start installing, you need to buy the module on the PrestaShop platform.

PrestaShop module on the marketplace

3. Configure settings in three tabs: General Settings, DataLayers, and Webhooks.

3.1 General Settings tab

This tab contains all the options for configuring the GTM snippet installation on every page of your PrestaShop site.

Add the following data:

  • Insert GTM snippet - enable this field to add the GTM snippet to every page on your PrestaShop store. And add the GTM web container ID (you can find it in your GTM account in the tab “Accounts”). The format should be the following: GTM-XXXXXXX.
  • GTM server container URL - use the subdomain you created for server-side tracking.
If you don’t have a subdomain, please follow the instructions to add a custom domain to the sGTM container.
  • Stape container identifier - that’s an optional parameter, but we highly recommend adding it as it increases protection against blockers. You can find the container identifier in the container section in Stape’s admin. For more detailed instructions, follow Stape’s guide on how to find the Stape container identifier.
  • Cookie Keeper - also optional; if you turn it on, you will minimize the impact of Safari ITP restrictions.
Example of General Settings Tab in PrestaShop module

3.2 DataLayer tab

In this tab, you can find toggles that enable dataLayer events. With their help, you can enrich the data by adding product and user information.

See the list of events that the module will push:

  • view_collection
  • view_item
  • add_to_cart
  • view_cart
  • remove_from_cart
  • begin_checkout
  • add_shipping_info
  • add_payment_info
  • purchase
dataLayer events in PrestaShop module

3.3 Webhooks tab

!

Please note:

A limitation of using webhooks on PrestaShop is that they do not include any cookie data, which is essential for tracking on any platform. Therefore, relying on webhook events should only be considered as a last resort if you are unable to track the data online through other means.

Here, you can configure the webhooks to be sent to a specified URL for different events, such as purchases and/or refunds.

To activate webhooks configuration, turn on “Send webhooks to server GTM container”. Then you need to add the URL of your server container (format: https://gtm.example.com/data).

Turn on the fields according to the type of event - purchase and/or refund.

Check out the blog posts on using and debugging webhooks:

Click “Save”.

Webhook configuration in PrestaShop module

4. Send data to the server Google Tag Manager container. The two most common methods to achieve this are:

5. Set up tracking within the server Google Tag Manager container.

Most major marketing and analytics tools already offer support for server-side tagging and include tags for sGTM.

You can use the pre-built templates for PrestaShop, which will simplify the setup process for Meta, GA4, and Google Ads. Check out how to set up the templates in our article.

Also, you can find guides on how to implement event tracking on the server-side:

Additionally, you can enhance sGTM data using Firestore or Google Sheets. Another useful feature of sGTM is its ability to send offline conversions to Facebook and AdWords.

Test PrestaShop module setup

Check the configuration on the website

To check your configuration, visit any website page and open your browser's console. Go to the network tab and search for your subdomain. If you find a request with a 200 status code, it means that the setup works properly.

Check custom domain on the website

Debug triggered events in GTM

Debugging in GTM for the PrestaShop website works the same way as for any other platform. To check whether the events you configured in dataLayer are triggered, you need to launch a preview in the web GTM container and take the required actions (e.g., add an item to the cart) on the website and check whether the tags fired in GTM. 

GTM preview

To sum up

Server-side tracking offers significant advantages for data collection, ensuring more accurate data is tracked. Stape developed the PrestaShop module to streamline the use of sGTM.

This module allows you to bypass ad blockers and browser restrictions, send webhooks from offline stores, and enrich the data with purchases and user data. 

If you need a fast and simple way to implement server-side tracking for your PrestaShop website, Stape’s module is a perfect solution. We provide support for our users in case they face any problems with the module configuration.

Try Stape for all things server-sideright now!