PHPackages                             rossmc/magento2-partytown - 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. rossmc/magento2-partytown

ActiveMagento2-module

rossmc/magento2-partytown
=========================

A module which adds Partytown to Magento 2

0.0.2(1y ago)7511.3k—0%8[2 issues](https://github.com/rossmc/magento2-partytown/issues)MITJavaScriptPHP ^8.1

Since Oct 31Pushed 1y ago4 watchersCompare

[ Source](https://github.com/rossmc/magento2-partytown)[ Packagist](https://packagist.org/packages/rossmc/magento2-partytown)[ Docs](https://github.com/rossmc/magento2-partytown)[ RSS](/packages/rossmc-magento2-partytown/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Rossmc Partytown
================

[](#rossmc-partytown)

[![Static Badge](https://camo.githubusercontent.com/6ebc6e6330574604ba48b8fc150eb2ae0cbca689396e27fd95fa7996dff1a2fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d70617469626c652d636f6d70617469626c653f7374796c653d666f722d7468652d6261646765266c6162656c3d487976254333254134266c6162656c436f6c6f723d25323330413134344226636f6c6f723d253233304132334239253230)](https://camo.githubusercontent.com/6ebc6e6330574604ba48b8fc150eb2ae0cbca689396e27fd95fa7996dff1a2fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d70617469626c652d636f6d70617469626c653f7374796c653d666f722d7468652d6261646765266c6162656c3d487976254333254134266c6162656c436f6c6f723d25323330413134344226636f6c6f723d253233304132334239253230)[![Packagist](https://camo.githubusercontent.com/1c7f16024ee936c1f86a0d3eebf6cca43ad78ec8f057bfe1a1cf00b7c9d0a803/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f73736d632f6d6167656e746f322d7061727479746f776e3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/rossmc/magento2-partytown)

Magento 2 module to run scripts such as GTM off main thread using [partytown](https://partytown.builder.io/).

**Performance Benefits**

- [Reduced main thread work](https://developer.chrome.com/docs/lighthouse/performance/mainthread-work-breakdown)
- [Reduce JavaScript execution time](https://developer.chrome.com/docs/lighthouse/performance/bootup-time/)
- [Fewer render-blocking resources](https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources/)

> ⚠️ **Warning:** Please note that this module is still in development and has not been tested fully. Partytown is not a one-size-fits-all solution and depending on which third-party scripts you are loading and how you may need to adjust the configuration. For example if new tags or scripts are added to GTM you may need to adjust the *Load Scripts on Main Thread* configuration. See the [partytown documentation](https://partytown.builder.io/) for more information.

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

[](#installation)

```
composer require rossmc/magento2-partytown
```

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

[](#configuration)

[![](./docs/configuration.jpg)](./docs/configuration.jpg)

### Uninstalling the Service Worker

[](#uninstalling-the-service-worker)

After disabling the module, you can use the configuration option to *Unregister Partytown Service Worker*. This helps remove the service worker from user's browser to prevent the cached service worker from interfering.

Usage
-----

[](#usage)

Once you have enabled and configured the module you can load scripts with Partytown off the main thread by adding `type="text/partytown"` to the script tag. See [here](https://partytown.builder.io/html) for more information on how to use partytown.
GTM for example:

```
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');

```

> **Note:** *Forwarding Events And Triggers* must be configured for GTM to work properly.

You will see your scripts loading with the updated `type="text/partytown-x"` tag in the source code. [![](./docs/head.jpg)](./docs/head.jpg)

In the Chrome DevTools Network tab you will see the gear icon by the file name to indicate the GTM script was loaded by the partytown service worker.
[![](./docs/network.jpg)](./docs/network.jpg)

And in the Sources panel, you will see the partytown threads.

Customising in your project
---------------------------

[](#customising-in-your-project)

If you need to override the configuration or change the partytown version you can do so by overriding them in your project. To regenerate the partytown files you can run the following commands:

```
npm install
npm run copylib
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.7% 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 ~49 days

Total

2

Last Release

515d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32a5811bb13d9f781a50a147ae01b38dbf1757cd48cae1fd27cc30332cc83c94?d=identicon)[rossmc](/maintainers/rossmc)

---

Top Contributors

[![rossmc](https://avatars.githubusercontent.com/u/2452991?v=4)](https://github.com/rossmc "rossmc (11 commits)")[![ssx](https://avatars.githubusercontent.com/u/254889?v=4)](https://github.com/ssx "ssx (1 commits)")

### Embed Badge

![Health badge](/badges/rossmc-magento2-partytown/health.svg)

```
[![Health](https://phpackages.com/badges/rossmc-magento2-partytown/health.svg)](https://phpackages.com/packages/rossmc-magento2-partytown)
```

###  Alternatives

[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.2M1](/packages/fastly-magento2)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

277.1k](/packages/mage-os-module-automatic-translation)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1326.2k](/packages/zepgram-module-rest)[graycore/magento2-graphql-introspection-cache

1015.2k](/packages/graycore-magento2-graphql-introspection-cache)[mage-os/mageos-common-async-events

Send REST requests to external endpoints asynchronously. This module implements the most common events like order creation and customer change.

147.7k2](/packages/mage-os-mageos-common-async-events)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

126.8k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

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