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
- PrestaShop admin access (Super Admin role)
- A Google Tag Manager account — a web + sGTM container
- DNS access for the tracking subdomain
- 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).
- Admin → Modules → Module Manager → Upload → upload the ZIP.
- After installation → Configure → enter your GTM Container ID (
GTM-XXXXXX). - 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:
- FTP / SSH into
themes/<your-theme>/templates/_partials/and openhead.tpl. - 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> - For the dataLayer events, create a
dataLayer.tplpartial and include it inproduct.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
- In Google Tag Manager, create a new Server container.
- Admin → Export Container → JSON.
- DataNostro dashboard → Containers → Create new → upload the JSON.
- 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:
- GA4 Configuration tag → Fields to Set:
server_container_url = https://track.yourstore.cz - The same for every GA4 Event tag (purchase, add_to_cart, view_item, …).
- (Optional) Meta Pixel tag → Advanced Settings → Use server-side endpoint = the same URL.
- 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
- Create a test product for CZK 1 in the PrestaShop admin.
- Make a complete purchase (add to cart → checkout → confirmation).
- In DataNostro Activity, verify that all 4 events arrived:
view_item,add_to_cart,begin_checkout,purchase. - 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
- Sklik native setup — instead of manual HTTP requests
- Meta CAPI deduplication
- Power-Ups — Cookie Keeper, Bot Detection