stape / gtm-server-side-magento-module

stape/gtm-server-side-magento-module

Stape Conversion Tracking Magento Module

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass GPL-3.0-only

Stape GTM Server Side Magento Module

If you have your store on Magento, Stape's GTM Server Side extension for Magento 2 can simplify the process and open up the world of server-side tagging.

The list of e-commerce events:

  • Collection view
  • View Item
  • Add to cart
  • Begin checkout
  • Add payment info
  • Purchase

User data:

  • Email
  • First name
  • Last name
  • Customer ID

Useful links:

Changelog

v1.0.41

  • added try/catch block for product collection;

v1.0.40

  • fixed issue with refund webhook;

v1.0.39

  • fixed exception thrown during config save with empty custom loader;

v1.0.38

  • fixed HEREDOC error happening with html minify enabled in production mode;

v1.0.37

  • added logic to generate GTM snippet via API;

v1.0.36

  • added admin configuration option to control purchase webhook;
  • added payment_type param for purchase webhook;
  • added shipping_tier param for purchase webhook;

v1.0.35

  • fixed PHP7.4 backward compatibility;
  • fixed CSP issue on checkout;

v1.0.34

  • improved SKU tracking

v1.0.33

  • added cart state to datalayer events;
  • extended cookies list;

v1.0.32

  • datalayer event value param added;

v1.0.31

  • renamed module in admin panel;
  • added select_item event;
  • added item_variant param to datalayer;

v1.0.30

  • added module version header;

v1.0.29

  • img-src CSP rule added;

v1.0.28

  • added PHP 8.4 compatibility;
  • fixed code style;

v1.0.27

  • added option to enable/disable '_stape' suffix in Datalayer events;

v1.0.26

  • removed unneeded CSP rules
  • added option to configure collection size for datalayer

v1.0.24

  • added caching of cookie domain when generating _sbp cookie
  • Fixed issue with the overridden price formatter pattern
  • Fixed billing address overwritten by shipping address issue

v1.0.23

  • added logic to fetch add to cart info and send the event if only productIds array is available

v1.0.22

  • fixed duplicate address creation for logged in customer on checkout

v1.0.21

  • removed Stape analytics option as no longer needed

v1.0.20

  • removed usage of md5 hash

v1.0.19

  • Implemented custom GTM loader generation logic with prefix as well as container id

v1.0.18

  • Fixed potential issue with sending multiple purchase webhook events.

v1.0.17

  • Hyva theme compatibility added.

v1.0.16

  • acl.xml added.

v1.0.15

  • fixed logic to trim GTM- only when custom loader and custom domain are populated.

v1.0.14

  • fixed xml layouts.
  • changed class methods visibility from private to public.

v1.0.13

  • fixed broken url generation logic.

v1.0.12

  • added quote_id param to purchase event and webhook.

v1.0.11

  • Update snippets with new param names and format.

v1.0.10

  • Fixed item price for purchase_stape event to include tax.

v1.0.9

  • Fixed issue with cookie being re-generated on every page load.

v1.0.2

  • Fixed issue with main snippet not showing when cookie keeper enabled.

v1.0.1

  • Set _sbp cookie logic added, unneeded functionality cleaned.

v1.0.0

  • Main functionality implemented.
Versions
Version Stability QA Status Compatibility Released
1.0.41 stable Fail Magento 2.4.7-2.4.9 Details 2026-04-29 11:24:37
1.0.40 stable Not tested Not yet tested Details 2026-04-20 09:37:56
1.0.39 stable Not tested Not yet tested Details 2026-04-16 07:25:56
1.0.38 stable Not tested Not yet tested Details 2026-04-02 13:26:05
1.0.37 stable Not tested Not yet tested Details 2026-02-09 13:41:00
1.0.36 stable Not tested Not yet tested Details 2026-01-23 08:25:07
1.0.35 stable Not tested Not yet tested Details 2026-01-15 12:52:18
1.0.34 stable Not tested Not yet tested Details 2025-12-29 14:24:02
1.0.33 stable Not tested Not yet tested Details 2025-12-11 08:58:02
1.0.32 stable Not tested Not yet tested Details 2025-11-10 12:25:45
1.0.31 stable Not tested Not yet tested Details 2025-10-20 12:33:43
1.0.30 stable Not tested Not yet tested Details 2025-09-10 11:08:10
1.0.29 stable Not tested Not yet tested Details 2025-08-27 08:07:47
1.0.28 stable Not tested Not yet tested Details 2025-07-28 09:16:18
1.0.27 stable Not tested Not yet tested Details 2025-07-22 20:06:00
1.0.26 stable Not tested Not yet tested Details 2025-07-09 08:38:25
1.0.25 stable Not tested Not yet tested Details 2025-03-21 14:53:34
1.0.24 stable Not tested Not yet tested Details 2025-02-24 11:15:48
1.0.23 stable Not tested Not yet tested Details 2025-01-21 13:34:17
1.0.22 stable Not tested Not yet tested Details 2024-12-19 11:13:07
1.0.21 stable Not tested Not yet tested Details 2024-12-18 11:47:46
1.0.20 stable Not tested Not yet tested Details 2024-10-24 12:51:54
1.0.19 stable Not tested Not yet tested Details 2024-10-24 10:53:03
1.0.18 stable Not tested Not yet tested Details 2024-09-08 19:55:06
1.0.17 stable Not tested Not yet tested Details 2024-08-16 19:00:17
1.0.16 stable Not tested Not yet tested Details 2024-06-20 06:13:22
1.0.15 stable Not tested Not yet tested Details 2024-04-30 07:18:20
1.0.14 stable Not tested Not yet tested Details 2024-04-23 19:19:27
1.0.13 stable Not tested Not yet tested Details 2024-04-04 20:01:01
1.0.12 stable Not tested Not yet tested Details 2024-03-25 20:36:35
1.0.11 stable Not tested Not yet tested Details 2024-03-06 21:34:33
1.0.10 stable Not tested Not yet tested Details 2024-01-18 08:53:06
1.0.9 stable Not tested Not yet tested Details 2023-12-22 21:49:36
1.0.8 stable Not tested Not yet tested Details 2023-10-03 09:35:51
1.0.7 stable Not tested Not yet tested Details 2023-09-21 09:12:17
1.0.6 stable Not tested Not yet tested Details 2023-09-14 13:44:14
1.0.5 stable Not tested Not yet tested Details 2023-08-04 19:55:58
1.0.4 stable Not tested Not yet tested Details 2023-05-15 20:11:30
1.0.3 stable Not tested Not yet tested Details 2023-05-15 19:31:24
1.0.0-dev dev Not tested Not yet tested Details 2023-05-10 11:40:07

Requires 2

Package Constraint
php >=7.4.0
jeremykendall/php-domain-parser ^6.0

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 1 1 warning (ruleset: Magento2)
PHPMD Warning 27 27 rule violations (IfStatementAssignment:16, UnusedFormalParameter:8, MissingImport:2, UnusedLocalVariable:1)
Cpd Warning 1 1 duplicated chunk spanning 25 total lines (min-lines=5, min-tokens=70)
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 45 45
2.4.8 45 45
2.4.9 45 45

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
GPL-3.0-only
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.