Skip to content
INSTALL BY CMS

PrestaShop — installing server-side tracking

Server-side tracking for PrestaShop 1.7+ and 8.x. A GTM module (free + paid), or a direct theme edit for full control over the dataLayer.

10 min Read Středně pokročilý Updated 5.6.2026

A guide for PrestaShop 1.7+ and 8.x: server-side tracking via DataNostro without a custom module. We use the official PrestaShop GTM module + standard GA4 dataLayer hooks.

Who this guide is for

  • PrestaShop 1.7.6+ or 8.x (the dataLayer hooks are standard from 1.7.6)
  • Time: 60–90 minutes for the first setup
  • Assumes FTP or SSH access to edit the theme

What you'll need

  1. PrestaShop admin access (Super Admin role)
  2. A Google Tag Manager account — a web + sGTM container
  3. DNS access for the tracking subdomain
  4. A DataNostro account and a created container

Step 1 — Install the GTM module

PrestaShop doesn't have an official GTM module from PrestaShop SA, but there are widely used community ones:

  • Lightweight GTM Module (free) — by Webwizards (search the PrestaShop Addons marketplace).
  • Google Tag Manager Pro (paid, ~€30) — by Idnovate, a better WooCommerce-style dataLayer.

If you don't want a module, see the alternative approach below (a direct theme edit).

  1. Admin → Modules → Module Manager → Upload → upload the ZIP.
  2. After installation → Configure → enter your GTM Container ID (GTM-XXXXXX).
  3. Tick Enable Enhanced Ecommerce and GA4-format datalayer (if the option exists).

Step 1 (alternative) — Without a module, via the theme

If you want full control over the dataLayer, you can do it manually:

  1. FTP / SSH into themes/<your-theme>/templates/_partials/ and open head.tpl.
  2. Right after {block name="head_seo"} insert the GTM snippet:
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-XXXXXX');</script>
  3. For the dataLayer events, create a dataLayer.tpl partial and include it in product.tpl, cart.tpl, order-confirmation.tpl. Example for the purchase event (order-confirmation.tpl):
    <script>
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      event: "purchase",
      ecommerce: {
        transaction_id: "{$order.reference}",
        value: {$order.total_paid|escape:'javascript':'UTF-8'},
        currency: "{$currency.iso_code}",
        tax: {$order.total_tax|escape:'javascript':'UTF-8'},
        shipping: {$order.total_shipping|escape:'javascript':'UTF-8'},
        items: [
          {foreach $products as $p}
          {
            item_id: "{$p.id_product}",
            item_name: "{$p.name|escape:'javascript':'UTF-8'}",
            price: {$p.unit_price_tax_incl|escape:'javascript':'UTF-8'},
            quantity: {$p.product_quantity},
          },
          {/foreach}
        ],
      },
    });
    </script>

This manual variant is more work, but you get exactly the dataLayer your GTM workspace expects. The module from Step 1 emits a format you may have to transform in GTM.

Step 2 — Deploy the sGTM container in DataNostro

  1. In Google Tag Manager, create a new Server container.
  2. Admin → Export Container → JSON.
  3. DataNostro dashboard → Containers → Create new → upload the JSON.
  4. DataNostro returns the endpoint URL + DNS instructions.

Step 3 — DNS

At your DNS provider, add a CNAME for the tracking subdomain (e.g. track.yourstore.cz) → target containers.datanostro.com.

Step 4 — Switch GA4 / Meta to sGTM

In the GTM web container:

  1. GA4 Configuration tag → Fields to Set:
    server_container_url = https://track.yourstore.cz
  2. The same for every GA4 Event tag (purchase, add_to_cart, view_item, …).
  3. (Optional) Meta Pixel tag → Advanced Settings → Use server-side endpoint = the same URL.
  4. Submit → Publish.

Step 5 — Connect the platforms in DataNostro

The standard process — GA4, Meta CAPI, Sklik, Heureka. For the exact steps, see Platform connectors.

Step 6 — Test

  1. Create a test product for CZK 1 in the PrestaShop admin.
  2. Make a complete purchase (add to cart → checkout → confirmation).
  3. In DataNostro Activity, verify that all 4 events arrived: view_item, add_to_cart, begin_checkout, purchase.
  4. In GA4 DebugView, verify the values match (value, items, transaction_id).

Common problems

"The community GTM module has bugs"

The Lightweight GTM Module is a good starting point, but its dataLayer format may be outdated (UA-style). If your GTM workspace expects GA4 events (view_item, purchase), either:

  • Use a paid module with GA4 support (Idnovate)
  • Or add a transformation tag in the GTM workspace that maps UA → GA4
  • Or switch to the manual variant from Step 1 (alternative)

"I see the purchase event twice (duplicate)"

If you have the GTM module and a manual dataLayer push in order-confirmation.tpl installed, both emit the purchase event. Choose one approach and remove the other.

"PrestaShop cache hides theme changes"

After editing .tpl files, admin → Advanced → Performance → Clear cache. If you use the Smarty cache (default on), your changes won't show without clearing it.

Next steps

Did this article help you?
✓ Thank you for the feedback