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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rossmc/magento2-partytown

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

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

A module which adds Partytown to Magento 2

0.0.2(1y ago)7513.0k↑67.5%7[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 2d 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 77% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity39

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

561d 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

[elgentos/regenerate-catalog-urls

Regenerate Catalog URL Rewrites (products, categories, cms pages)

2842.6M](/packages/elgentos-regenerate-catalog-urls)[nosto/module-nostotagging

Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.

27703.7k4](/packages/nosto-module-nostotagging)[tig/postnl-magento2

TIG Magento 2 PostNL extension

59570.5k5](/packages/tig-postnl-magento2)[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1860.2k](/packages/myparcelnl-magento)[loki/magento2-components

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

1011.8k26](/packages/loki-magento2-components)[zwernemann/module-withdrawal

Magento 2 EU Withdrawal Button Module - Adds a withdrawal/revocation button for orders in compliance with EU Directive (EU) 2023/2673

244.9k2](/packages/zwernemann-module-withdrawal)

PHPackages © 2026

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