PHPackages                             buckaroo/magento2analytics - 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. buckaroo/magento2analytics

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

buckaroo/magento2analytics
==========================

Buckaroo Magento2 Analytics extension

v1.1.1(2y ago)335.5k↓38.5%4[1 issues](https://github.com/buckaroo-it/Magento2_Analytics/issues)[1 PRs](https://github.com/buckaroo-it/Magento2_Analytics/pulls)MITPHP

Since Sep 2Pushed 7mo ago7 watchersCompare

[ Source](https://github.com/buckaroo-it/Magento2_Analytics)[ Packagist](https://packagist.org/packages/buckaroo/magento2analytics)[ RSS](/packages/buckaroo-magento2analytics/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (14)Used By (0)

 [![](https://camo.githubusercontent.com/32ed0a62bf92bae6c029d5963502aa24c04fa29ffbe83d4354c61d0c1d226116/68747470733a2f2f7777772e6275636b61726f6f2e6e6c2f6d656469612f6f737068737031752f6d6167656e746f325f676f6f676c65616e616c79746963735f69636f6e2e706e67)](https://camo.githubusercontent.com/32ed0a62bf92bae6c029d5963502aa24c04fa29ffbe83d4354c61d0c1d226116/68747470733a2f2f7777772e6275636b61726f6f2e6e6c2f6d656469612f6f737068737031752f6d6167656e746f325f676f6f676c65616e616c79746963735f69636f6e2e706e67)

Buckaroo Magento2 Analytics extension
=====================================

[](#buckaroo-magento2-analytics-extension)

[![Latest release](https://camo.githubusercontent.com/d7dd50ba92584af44736b6f43b1a39515e955aaadd14fd74d26333173b172796/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f6275636b61726f6f2d69742f4d6167656e746f325f416e616c7974696373)](https://github.com/buckaroo-it/Magento2_Analytics/releases)

### Index

[](#index)

- [Installation and configuration](#installation-and-configuration)
- [Usage](#usage)
- [Serverside](#serverside)
- [Features](#features)
- [Contribute](#contribute)
- [Versioning](#versioning)
- [Additional information](#additional-information)

---

### Installation and configuration

[](#installation-and-configuration)

```
composer require buckaroo/magento2analytics
php bin/magento module:enable Buckaroo_Magento2Analytics
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

```

### Usage

[](#usage)

#### General information

[](#general-information)

GA Tracking does not allocate properly the conversion source when the transaction happens cross-browser or cross-device. Visitor lands on the website from an ad campaign, goes through the order process, but the payment process takes place on a different device or browser and success page is also displayed in a different device In order to handle this situation, we track the Google Client ID against the order and we can trigger an enriched version of the tracking code in the success page, by adding the clientId parameter.

### Javascript / GTM

[](#javascript--gtm)

`clientId` value is passed as a parameter in the URL of the success page, part of the redirect process. This can be extracted and used in the javascript code that triggers the GA/UA/GTM/other event for the conversion. Standard structure of the URL is the following: `/checkout/onepage/success/?clientId=****/`

**and the clientId can be extracted:**

```
    try{
        currentPageUrl = window.location.href;
        myClientId = currentPageUrl.split('clientId=')[1].split('/')[0];
    } catch(error) {
        myClientId = '';
    }

```

**and sent to GA/UA part of the tracking code:**

```
    ga('create', 'UA-XXXXX-Y', {
        'storage': 'none',
        'clientId': myClientId
    });

```

### Serverside

[](#serverside)

The information related to clientId is also stored in the database. And this can be used on the server side level, via the Model repository `Buckaroo\Magento2Analytics\Model\AnalyticsRepository` using the `quoteId`:

```
use Buckaroo\Magento2Analytics\Model\AnalyticsRepository;
use Magento\Framework\Exception\NoSuchEntityException;

class MyCustomViewModel
{
    public function __construct(
        AnalyticsRepository $analyticsRepo
    ) {
        $this->analyticsRepo = $analyticsRepo;
    }

    public function getClientId($quoteId)
    {
        $clientId = null;
        try {
            $clientIdData = $analyticsRepo->getByQuoteId($quote->getId());
            return $clientIdData->getClientId();
        } catch(\Exception $e) {
            throw new NoSuchEntityException(__('ClientId not found for quoteId' . $quoteId ));
        }

    }
}

```

### Features

[](#features)

#### Dynamic URL Parameters on Success Page Based on Cookies:

[](#dynamic-url-parameters-on-success-page-based-on-cookies)

• This new feature enables you to add unlimited URL parameters on the success page, utilizing information stored in cookies. This is a significant addition that enables more granular tracking of customer activity and success page interactions, leading to more precise and actionable analytics data.

• The new module is designed for easy use: simply add another pair of cookie name, URL parameter, and the replace regex if you want to extract only a portion of the text. This flexibility allows for precise control over what information is captured and used in your URL parameters.

**How to Use:**
To utilize this feature:
**1.** Go to the Buckaroo Magento2\_Analytics module settings (Stores → Settings → Configuration → Sales → Buckaroo → GA Tracking Options).

[![Google_Analytics_Configuration](https://private-user-images.githubusercontent.com/105488705/245401801-c2308408-46ff-4a66-8252-f224739e53de.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUzNjAyNTYsIm5iZiI6MTc3NTM1OTk1NiwicGF0aCI6Ii8xMDU0ODg3MDUvMjQ1NDAxODAxLWMyMzA4NDA4LTQ2ZmYtNGE2Ni04MjUyLWYyMjQ3MzllNTNkZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwNVQwMzMyMzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lODdkZmNjYzZiMDgyOTEyZDU4YWI0Mzk0ZDI1ZWIzYzA0ZjU1NmRkMjQ3MzA3MjM0MjUwNzhkZmRjNDNjY2FjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.8SICOL4zpRJByJKhMTlzUicWMuvtw5QvYYwglzlQKp0)](https://private-user-images.githubusercontent.com/105488705/245401801-c2308408-46ff-4a66-8252-f224739e53de.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUzNjAyNTYsIm5iZiI6MTc3NTM1OTk1NiwicGF0aCI6Ii8xMDU0ODg3MDUvMjQ1NDAxODAxLWMyMzA4NDA4LTQ2ZmYtNGE2Ni04MjUyLWYyMjQ3MzllNTNkZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwNVQwMzMyMzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lODdkZmNjYzZiMDgyOTEyZDU4YWI0Mzk0ZDI1ZWIzYzA0ZjU1NmRkMjQ3MzA3MjM0MjUwNzhkZmRjNDNjY2FjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.8SICOL4zpRJByJKhMTlzUicWMuvtw5QvYYwglzlQKp0)

**2.** Enable GA Tracking.
**3.** Add a new pair consisting of the cookie name and the URL parameter that you wish to set based on the cookie's value.
**4.** (Optional) If you only need to extract a specific part of the text, provide a replace regex.
**5.** Save the settings.
**6.** The module will automatically handle the rest, setting the URL parameters on your success page based on the specified cookies.

### Contribute

[](#contribute)

We really appreciate it when developers contribute to improve the Buckaroo plugins. If you want to contribute as well, then please follow our [Contribution Guidelines](CONTRIBUTING.md).

### Versioning

[](#versioning)

 [![](https://camo.githubusercontent.com/51bfb67265be8ab7e6af3637c4573fa9c812653be61480fae6b88119511e593a/68747470733a2f2f7777772e6275636b61726f6f2e6e6c2f6d656469612f333438302f6d6167656e746f5f76657273696f6e696e672e706e67)](https://camo.githubusercontent.com/51bfb67265be8ab7e6af3637c4573fa9c812653be61480fae6b88119511e593a/68747470733a2f2f7777772e6275636b61726f6f2e6e6c2f6d656469612f333438302f6d6167656e746f5f76657273696f6e696e672e706e67)

- **MAJOR:** Breaking changes that require additional testing/caution.
- **MINOR:** Changes that should not have a big impact.
- **PATCHES:** Bug and hotfixes only.

### Additional information

[](#additional-information)

- **Support:**
- **Contact:**  or +31 (0)30 711 50 50

**Please note:**
This file has been prepared with the greatest possible care and is subject to language and/or spelling errors.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.8% 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 ~162 days

Total

5

Last Release

1071d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aee7e92d03b2430619af3bce5a15e98136d4880889fce092d83ce134085fe1f7?d=identicon)[buckaroo](/maintainers/buckaroo)

---

Top Contributors

[![florinel-chis](https://avatars.githubusercontent.com/u/2117053?v=4)](https://github.com/florinel-chis "florinel-chis (26 commits)")[![LucianTuriacArnia](https://avatars.githubusercontent.com/u/106905746?v=4)](https://github.com/LucianTuriacArnia "LucianTuriacArnia (7 commits)")[![Buckaroo-Rene](https://avatars.githubusercontent.com/u/105488705?v=4)](https://github.com/Buckaroo-Rene "Buckaroo-Rene (5 commits)")[![harli91](https://avatars.githubusercontent.com/u/3657605?v=4)](https://github.com/harli91 "harli91 (2 commits)")[![Buckaroo-Rens](https://avatars.githubusercontent.com/u/59445921?v=4)](https://github.com/Buckaroo-Rens "Buckaroo-Rens (2 commits)")[![saranchuk-hys](https://avatars.githubusercontent.com/u/59468793?v=4)](https://github.com/saranchuk-hys "saranchuk-hys (2 commits)")[![serpentscode](https://avatars.githubusercontent.com/u/2503034?v=4)](https://github.com/serpentscode "serpentscode (1 commits)")

---

Tags

cross-browser-compatibilitycross-browser-trackinggoogle-analyticsmagento2magento2-extensionmagento2-modulemagento2-plugin

### Embed Badge

![Health badge](/badges/buckaroo-magento2analytics/health.svg)

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

###  Alternatives

[nelexa/roach-php-bundle

Symfony bundle for roach-php/core

101.3k](/packages/nelexa-roach-php-bundle)

PHPackages © 2026

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