GA4, Pixels, Chat & GTM — installation and configuration guide · by Softnet Sistemas
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.
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.