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
PrestaShop 1.7.0.0 to 9.x.
No external service or account is required. The module runs entirely on your own store.
3. Installation
In your back office, go to Modules → Module Manager.
Click Upload a module and select the module ZIP file (sncustomcode.zip).
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
On the configuration screen, click Add snippet.
Give it a clear Name (e.g. “GA4”, “Meta Pixel”, “Chat widget”).
Choose the Position (see the table below).
Paste your code in the editor. It is stored exactly as you paste it — script and meta tags are never stripped.
Optionally set the targeting options (pages, device, language, visibility, priority).
Make sure Enabled is ticked and click Save.
Open your store and confirm the tag loads correctly.
Positions
Position
Where it prints
Typical use
Head
Inside <head>
GA4, Matomo, Clarity, verification meta tags, the script part of GTM
Body start
Right after <body>
The Google Tag Manager <noscript> snippet
Body end
Before </body>
Chat widgets and non-critical scripts
5. Targeting options
Pages — show the snippet on all pages, or only on selected page types (home, product, category, CMS, cart, checkout, contact, search).
Device — all devices, mobile only, or desktop only.
Language — all languages or one specific language.
Visibility — Everyone; Hide from logged-in employees (keep your own visits out of your analytics); or Employees only (test a new tag safely in production before it goes live).
Priority — lower numbers print first when several snippets share a position.
6. Managing snippets
Enable or disable any snippet without deleting it — pause a pixel while you test, then switch it back on.
Edit or delete a snippet from the list at any time.
On multistore installations, snippets saved in a single-shop context apply only to that shop.
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
I cannot see the code on my store. Check that Active is ticked, that the position is the right one and that the targeting (page type, device, language) does not exclude the page you are looking at. If visibility is Employees only, you need to be logged in as an employee. Also clear the PrestaShop cache and your browser cache.
The page breaks or does not load after saving. It is usually a script tag that was not closed. Untick Active on that snippet, the page goes back to normal, then fix the code.
My own visits show up in my analytics. Set visibility to Hide from logged-in employees; it works while you are logged in to the back office in that browser.
Two snippets load in an order I do not want. Use Priority: lower numbers are printed first when they share a position.
The Tag Manager noscript does not work. It must go in Body start, not in Head.
I run several shops. Snippets saved in one shop's context apply to that shop only.
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.
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.