PHPackages                             elgentos/serversideanalytics2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. elgentos/serversideanalytics2

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

elgentos/serversideanalytics2
=============================

Elgentos\_ServerSideAnalytics for magento 2

2.0.6(11mo ago)7095.7k—4%24[3 issues](https://github.com/elgentos/magento2-serversideanalytics/issues)PHPPHP &gt;=8.2.0

Since Oct 28Pushed 11mo ago8 watchersCompare

[ Source](https://github.com/elgentos/magento2-serversideanalytics)[ Packagist](https://packagist.org/packages/elgentos/serversideanalytics2)[ RSS](/packages/elgentos-serversideanalytics2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (64)Used By (0)

Server Side Analytics for Magento 2
===================================

[](#server-side-analytics-for-magento-2)

This extension aims to solve the problem of discrepancies between Magento revenue reports and the revenue reports in Google Analytics.

That problem arises due to the fact that a certain number of people close the browser window before returning to Magento's success page. Since Google Analytics is Javascript based, and thus client based, the GA Purchase Event will not be fired and the order will not be registered in Analytics.

Another reason why this problem arises is that people decide to pay at a later point in time through a different platform (like the PSP's), using a link in an email for example.

Installation
------------

[](#installation)

```
composer require elgentos/serversideanalytics2
bin/magento setup:upgrade
```

### Sample query for GraphQL to set the GA data

[](#sample-query-for-graphql-to-set-the-ga-data)

```
mutation AddGaUserId($cartId: String!, $gaUserId: String, $gaSessionId: String) {
                            AddGaUserId(input: {
                                    cartId: $cartId
                                    gaUserId: $gaUserId
                                    gaSessionId: $gaSessionId
                                }
                            ),
                            {
                               cartId
                               maskedId
                            }
                    }

```

Further info
------------

[](#further-info)

- Compatible with GA4 Measurement Protocol;
- When using YireoGTM, you can either disable the purchase event on the success page, or simply not send it to GA with GTM. Or just keep it, since Google will fix double transactionId's
- Debugging is enabled when Magento is in developer mode. See `var/log/system.log` for the log;
- Exceptions will be logged to `var/log/exceptions.log`;
- The products in the payload are retrieve on invoice-basis, not on order-basis;
- An event has been added for you to add or overwrite custom fields to products in the purchase event; `elgentos_serversideanalytics_product_item_transport_object`;
- An event has been added for you to add or overwrite custom fields to transaction data in the purchase event; `elgentos_serversideanalytics_transaction_data_transport_object`;
- An event has been added for you to add or overwrite fields to tracking data in the purchase event; `elgentos_serversideanalytics_tracking_data_transport_object`;
- Testing can be done by dispatching `test_event_for_serversideanalytics` with a `$payment` (`\Magento\Sales\Order\Payment`) object in the payload;
- magerun2 dev:events:fire --eventName sales\_order\_payment\_pay --parameters "payment::\\Magento\\Sales\\Model\\Order\\Payment:X;invoice::\\Magento\\Sales\\Model\\Order\\Invoice:X";

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance50

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 51.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Total

40

Last Release

357d ago

Major Versions

0.1.10 → 1.0.02022-09-15

1.3.1 → 2.0.02024-08-30

1.4.0 → 2.0.12024-11-04

1.4.1 → 2.0.22024-11-04

PHP version history (3 changes)0.1.3PHP &gt;=7.1.0

1.2.0PHP &gt;=8.1.0

2.0.0PHP &gt;=8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/88a6d8dc588e8f2a0948335563a754687f71304f0bd3b7f7049d4bcdc00a563c?d=identicon)[peterjaap](/maintainers/peterjaap)

![](https://www.gravatar.com/avatar/91631a876a2495358801220afbd8d869040f8917b913c21a99b9984ad26634df?d=identicon)[WouterSteen](/maintainers/WouterSteen)

---

Top Contributors

[![WouterSteen](https://avatars.githubusercontent.com/u/5089604?v=4)](https://github.com/WouterSteen "WouterSteen (96 commits)")[![indykoning](https://avatars.githubusercontent.com/u/15870933?v=4)](https://github.com/indykoning "indykoning (27 commits)")[![peterjaap](https://avatars.githubusercontent.com/u/431360?v=4)](https://github.com/peterjaap "peterjaap (18 commits)")[![JustinElst](https://avatars.githubusercontent.com/u/249633?v=4)](https://github.com/JustinElst "JustinElst (17 commits)")[![claudio-ferraro](https://avatars.githubusercontent.com/u/54107647?v=4)](https://github.com/claudio-ferraro "claudio-ferraro (8 commits)")[![denniselgentos](https://avatars.githubusercontent.com/u/150702252?v=4)](https://github.com/denniselgentos "denniselgentos (6 commits)")[![JeroenBoersma](https://avatars.githubusercontent.com/u/1163348?v=4)](https://github.com/JeroenBoersma "JeroenBoersma (5 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (3 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (2 commits)")[![JoostWan](https://avatars.githubusercontent.com/u/5435412?v=4)](https://github.com/JoostWan "JoostWan (1 commits)")[![mage2pratik](https://avatars.githubusercontent.com/u/33807558?v=4)](https://github.com/mage2pratik "mage2pratik (1 commits)")[![eneskirca](https://avatars.githubusercontent.com/u/39504888?v=4)](https://github.com/eneskirca "eneskirca (1 commits)")[![DavidLambauer](https://avatars.githubusercontent.com/u/1841317?v=4)](https://github.com/DavidLambauer "DavidLambauer (1 commits)")

---

Tags

hacktoberfestmagento2magento2-extensionmagento2-module

### Embed Badge

![Health badge](/badges/elgentos-serversideanalytics2/health.svg)

```
[![Health](https://phpackages.com/badges/elgentos-serversideanalytics2/health.svg)](https://phpackages.com/packages/elgentos-serversideanalytics2)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
