PHPackages                             hk2/marketing-analytics - 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. hk2/marketing-analytics

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

hk2/marketing-analytics
=======================

Magento 2 Marketing Analytics: Google Analytics, Facebook Pixel, Product Feed &amp; Conversion Tracking

1.0.0(2mo ago)01OSL-3.0PHPPHP ^8.1 || ^8.2 || ^8.3 || ^8.4CI passing

Since May 12Pushed 2mo agoCompare

[ Source](https://github.com/basantmandal/magento2-marketing-analytics-module)[ Packagist](https://packagist.org/packages/hk2/marketing-analytics)[ RSS](/packages/hk2-marketing-analytics/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (2)Versions (2)Used By (0)

[![Version](https://camo.githubusercontent.com/d30d7eb420ef541fcc2347e387e18f34920e4a5e087534e4e17364470dc6c21f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e302e302d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/d30d7eb420ef541fcc2347e387e18f34920e4a5e087534e4e17364470dc6c21f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e302e302d626c75653f7374796c653d666c61742d737175617265)[![Magento](https://camo.githubusercontent.com/cc7afc3a994043bd5e1bbe18fdecdf4377481f03e2dc7a05728c3174c7da66bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e782d6639373331363f7374796c653d666c61742d737175617265266c6f676f3d6d6167656e746f266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/cc7afc3a994043bd5e1bbe18fdecdf4377481f03e2dc7a05728c3174c7da66bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e782d6639373331363f7374796c653d666c61742d737175617265266c6f676f3d6d6167656e746f266c6f676f436f6c6f723d7768697465)[![PHP](https://camo.githubusercontent.com/2f2d39f30d9a245b748ead3268e5de0819ddab6c31a393904a4f33652b504e79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3763336165643f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/2f2d39f30d9a245b748ead3268e5de0819ddab6c31a393904a4f33652b504e79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3763336165643f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)[![License](https://camo.githubusercontent.com/a3fd2257982f64afbde00a66a8ab5984ee3f6e176f00eb2ec4ea61d862bc113b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4f534c2d2d332e302d677265656e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/a3fd2257982f64afbde00a66a8ab5984ee3f6e176f00eb2ec4ea61d862bc113b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4f534c2d2d332e302d677265656e3f7374796c653d666c61742d737175617265)[ ![Packagist](https://camo.githubusercontent.com/f5af7b1fd9e51246d5affc12687cafada788d4487cbcd4b8c48977b9009165ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686b322f6d61726b6574696e672d616e616c79746963733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hk2/marketing-analytics)
[ ![Website](https://camo.githubusercontent.com/48510337f411c7e193a31e9bdb6802d49664918dac999471dcc705c9a94fa031/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562736974652d3030303f7374796c653d666c61742d737175617265266c6f676f3d6b6f2d6669266c6f676f436f6c6f723d7768697465)](https://www.basantmandal.in)[ ![LinkedIn](https://camo.githubusercontent.com/f47f622117d99af4d0fcba939449e0949d2301d48601b78a25b6e7e1cf580d3e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c696e6b6564496e2d3041363643323f7374796c653d666c61742d737175617265266c6f676f3d6c696e6b6564696e266c6f676f436f6c6f723d7768697465)](https://www.linkedin.com/in/basantmandal/)[ ![Email](https://camo.githubusercontent.com/4fb7fe62859d942d68ae2f48af7c8fb6165e8f1dc236fa5bbc970e01efff28ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456d61696c2d737570706f7274253430626173616e746d616e64616c2e696e2d626c75653f7374796c653d666c61742d737175617265266c6f676f3d676d61696c)](mailto:support@basantmandal.in)

--- HK2 Marketing Analytics
=======================

[](#hk2-marketing-analytics)

Overview
--------

[](#overview)

HK2 Marketing Analytics integrates Google Analytics 4 (GA4), Facebook (Meta) Pixel, and Google Product Feed generation into your Magento 2 store. It provides a centralized configuration panel for managing analytics and tracking settings without modifying theme templates.

Problem Statement
-----------------

[](#problem-statement)

Magento store owners need to integrate multiple analytics and marketing tracking services to measure store performance, understand customer behavior, and optimize marketing campaigns. Manually editing templates for each service is error-prone, requires theme maintenance, and does not scale across multiple services.

Solution Approach
-----------------

[](#solution-approach)

This module provides a unified configuration-driven integration for Google Analytics 4 and Facebook Pixel tracking. Tracking scripts are injected automatically on all frontend pages via a layout handle, with no template overrides required. A scheduled cron job generates the Google Product Feed for Merchant Center submissions.

Who is this for?
----------------

[](#who-is-this-for)

- Magento store owners who need Google Analytics 4 tracking
- Merchants running Facebook advertising campaigns
- Stores submitting product data to Google Merchant Center
- Developers who want a clean, configurable tracking solution without template modifications

Use Cases
---------

[](#use-cases)

- Track store traffic and user behavior with Google Analytics 4
- Measure Facebook ad performance with Meta Pixel PageView tracking
- Submit product catalog to Google Shopping via automated feed generation
- Manage all tracking configurations from a single admin panel

Key Features
------------

[](#key-features)

- **Google Analytics 4 Integration** — Inject GA4 gtag.js with your Measurement ID on all pages
- **Facebook (Meta) Pixel** — Inject Facebook Pixel with automatic PageView event tracking
- **Google Product Feed** — Scheduled daily XML product feed generation for Google Merchant Center
- **Centralized Configuration** — Manage all tracking settings from a single admin panel
- **Automatic Injection** — Tracking scripts load automatically with no template edits
- **ACL Protected** — Granular admin permissions for configuration access
- **Cron-Based Feed** — Automated daily feed generation at 2:00 AM

System Requirements
-------------------

[](#system-requirements)

- Magento 2.4.x (Open Source or Adobe Commerce)
- PHP 8.1, 8.2, 8.3, or 8.4
- Composer
- `hk2/core` module (^1.0)

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

[](#installation)

See [Installation Guide](docs/installation.md) for detailed instructions.

```
composer require hk2/marketing-analytics
bin/magento module:enable HK2_MarketingAnalytics
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

Configuration
-------------

[](#configuration)

Navigate to **Stores &gt; Configuration &gt; HK2 &gt; Marketing Analytics** in the Magento Admin Panel.

Available settings:

SettingDescriptionEnable ModuleToggle the module on/offGoogle Analytics / GA4 Measurement IDYour GA4 measurement ID (format: `G-XXXXXXXXXX`)Facebook (Meta) Pixel IDYour Facebook Pixel IDEnable Google Product FeedEnable daily product feed generation for Google ShoppingContent Security Policy (CSP)
-----------------------------

[](#content-security-policy-csp)

If you have Content Security Policy enabled in your Magento store, ensure the following external domains are whitelisted:

- `https://www.googletagmanager.com` — Google Analytics
- `https://connect.facebook.net` — Facebook Pixel
- `https://www.google-analytics.com` — Google Analytics

Privacy &amp; GDPR
------------------

[](#privacy--gdpr)

When using Google Analytics and Facebook Pixel, ensure compliance with applicable privacy regulations:

- Configure your cookie consent mechanism before loading tracking scripts
- Update your privacy policy to disclose third-party tracking services
- Configure Google Analytics IP anonymization if required in your jurisdiction
- Provide opt-out mechanisms where required by law

For detailed usage instructions, refer to the [Usage Guide](docs/usage.md).

Documentation
-------------

[](#documentation)

- [Installation Guide](docs/installation.md)
- [Usage Guide](docs/usage.md)
- [Compatibility](docs/compatibility.md)

Known Limitations
-----------------

[](#known-limitations)

- The Google Product Feed generation is scheduled for daily execution and cannot be triggered manually from the admin panel
- Product feed is generated as XML for Google Shopping; other feed formats are not supported
- The module requires the `hk2/core` dependency for the HK2 admin tab and shared components

Contributing
------------

[](#contributing)

Contributions are welcome. Please open an issue or pull request on the repository.

Report security vulnerabilities to  — see [SECURITY.md](SECURITY.md) for details.

License
-------

[](#license)

This module is licensed under the Open Software License 3.0 (OSL-3.0). See [LICENSE.txt](LICENSE.txt).

Disclaimer
----------

[](#disclaimer)

This module is provided "as is" without warranty of any kind. The authors are not responsible for any damages arising from its use. Ensure compliance with applicable laws and regulations when using tracking technologies.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% 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

Unknown

Total

1

Last Release

73d ago

### Community

Maintainers

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

---

Top Contributors

[![basantmandal](https://avatars.githubusercontent.com/u/69835601?v=4)](https://github.com/basantmandal "basantmandal (20 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (6 commits)")

---

Tags

extensionmagento2marketing analyticsHK2Basantbasantmandal.inBasant Mandal

### Embed Badge

![Health badge](/badges/hk2-marketing-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/hk2-marketing-analytics/health.svg)](https://phpackages.com/packages/hk2-marketing-analytics)
```

###  Alternatives

[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68357.9k](/packages/run-as-root-magento2-prometheus-exporter)[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1860.2k](/packages/myparcelnl-magento)[rafaelcg/magento2-quicklink

Faster subsequent page-loads by prefetching in-viewport links during idle time

5115.9k](/packages/rafaelcg-magento2-quicklink)[mage-os/module-llm-txt

AI-powered LLMs.txt generation for Magento 2 / Mage-OS stores. Help AI systems understand your store with OpenAI-generated content.

234.4k](/packages/mage-os-module-llm-txt)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1011.8k26](/packages/loki-magento2-components)[angeo/module-llms-txt

Magento 2 module for AI Engine Optimization (AEO). Generates spec-compliant llms.txt and llms-full.txt per llmstxt.org standard, plus streaming JSONL for vector indexing. Multi-store, multi-website, CLI, cron, async admin UI, Page Builder-aware sanitization, customer-group pricing, atomic writes, ETag/Cache-Control, .md mirrors.

111.1k](/packages/angeo-module-llms-txt)

PHPackages © 2026

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