sncustomcode manual for PrestaShop: GA4, pixels and GTM without touching your theme

GA4, Pixels, Chat & GTM — installation and configuration guide · by Softnet Sistemas

In short: sncustomcode is a PrestaShop 1.7 to 9 module that inserts your GA4, Google Tag Manager, Meta or TikTok pixels or a chat widget into the head or body, without editing your theme. You install it from the Module Manager, create a snippet, pick its position and targeting, and check it on your store. This guide walks you through it step by step, with recipes and the most common problems. Updated 8 November 2026.

1. What this module does

Custom Code inserts any third-party snippet (Google Analytics 4, Google Tag Manager, Meta/TikTok/Pinterest pixels, live-chat widgets, verification tags, custom CSS/JS) into the <head> or <body> of every page of your store — without editing a single template file, and safe from theme updates. Each snippet can be targeted by page type, device, language and visibility.

2. Requirements

3. Installation

  1. In your back office, go to Modules → Module Manager.
  2. Click Upload a module and select the module ZIP file (sncustomcode.zip).
  3. PrestaShop installs it automatically. When it finishes, click Configure.
The module registers three display hooks on install: displayHeader, displayAfterBodyOpeningTag and displayBeforeBodyClosingTag. No template edits are needed.

4. Adding your first snippet

  1. On the configuration screen, click Add snippet.
  2. Give it a clear Name (e.g. “GA4”, “Meta Pixel”, “Chat widget”).
  3. Choose the Position (see the table below).
  4. Paste your code in the editor. It is stored exactly as you paste it — script and meta tags are never stripped.
  5. Optionally set the targeting options (pages, device, language, visibility, priority).
  6. Make sure Enabled is ticked and click Save.
  7. Open your store and confirm the tag loads correctly.

Positions

PositionWhere it printsTypical use
HeadInside <head>GA4, Matomo, Clarity, verification meta tags, the script part of GTM
Body startRight after <body>The Google Tag Manager <noscript> snippet
Body endBefore </body>Chat widgets and non-critical scripts

5. Targeting options

6. Managing snippets

7. Uninstalling

Uninstalling the module from the Module Manager removes all snippets and the inserted code from your store pages. No residual data is left behind.

Tip: a badly closed script tag can break page rendering. After saving a snippet, open your store front office and check that pages load correctly.

8. Quick recipes

Google Analytics 4

Create a snippet in the Head position and paste the gtag.js code Google Analytics gives you. To keep your own visits out of your numbers, set visibility to Hide from logged-in employees.

Google Tag Manager

It takes two snippets: the script in Head and the <noscript> part in Body start. Each one goes in its own position, as the table in section 4 shows.

Meta or TikTok pixel

Use the Head position. If you only want it to load on certain pages (for example product, cart and checkout), pick those page types in the targeting options.

Chat widget

Use Body end, so it does not slow down the rest of the page.

Testing a new tag safely

Create the snippet with visibility set to Employees only, open the store while logged in to your back office and check that it works. When it is fine, switch it to Everyone.

9. Common problems

Frequently asked questions

Do I have to edit my theme templates?

No. On install the module hooks into three display hooks and your code is stored in the module itself.

Which PrestaShop versions does it support?

PrestaShop 1.7.0.0 to 9.x. It needs no external service or account.

What happens to my snippets if I uninstall it?

All snippets and the code inserted into your store pages are removed. No residual data is left.

How much does it cost and how do I buy it?

€29 + VAT, one-time, with instant delivery by email. You buy it on the sncustomcode page, where you will also find the screenshots and the other PrestaShop modules.

See sncustomcode (€29 + VAT, one-time) · All PrestaShop modules

Custom Code in Head & Body · Softnet Sistemas SL · Support: support@aiprocessia.com
This module is actively maintained and compatible with PrestaShop 1.7 through 9.

Softnet Group · since 1996

See the group's other solutions
  • Softnet SistemasIT support and maintenance, websites and ERP for businesses in Alicante (in Spanish).
  • AIPROCESSIAAI assistants for your store, website or documents, AI invoice processing and custom automation.
  • FicharConMóvilTime tracking from your phone: clock in with GPS, WhatsApp or Telegram.
  • MyGeoSEOMonthly SEO and GEO report: what Google and AI assistants say about your business.
  • Automatizaciones IA AlicanteAI automation in Alicante, in person: projects and training (in Spanish).
  • Diseño y FotoPhoto and video studio: product photography, video and studio hire (in Spanish).