Web push notifications for Joomla
Many Joomla sites look for a “push notification extension”. You may not need one: Joomla runs on your own hosting, so a root file and one script tag do the job. Here’s how to do it cleanly in Joomla 4 and 5.
- Upload sw.js to the Joomla root — the folder with configuration.php.
- Add the snippet before </head> in a child template (Joomla 4.1+ supports child templates).
- Don’t paste scripts into a Custom module: editor filtering often strips them.
- RSS-to-push can announce new articles automatically using Joomla’s feed.
1. Upload sw.js
Every web push service has the same requirement: browsers only deliver push to a service worker served from your domain, and Pusharoo registers its worker with scope /, so https://yoursite.com/sw.js must open as JavaScript. Platforms where you control the web root make this a one-minute job; hosted platforms that don’t let you place a root file need a workaround or won’t work.
On Joomla, upload sw.js next to configuration.php and index.php. Joomla’s .htaccess serves existing files directly, so /sw.js opens without extra rules. If you’re on Apache, the cache headers from the docs can go in the same .htaccess.
2. Add the snippet in a child template
- Go to System → Site Templates, open your template (for example Cassiopeia) and click Create Child Template.
- Assign the child template as the default style.
- In the child template, create or override
index.phpand paste the snippet before</head>:<script src="https://pusharoo.com/sdk/pusharoo.js" data-site="pk_your_site_key" async></script> - Save, then clear the cache under System → Clear Cache.
Child templates keep your change safe when Cassiopeia updates. If you use a commercial template framework, it usually has a “custom code before </head>” field — use that instead.
Why not a Custom module?
It’s tempting to paste the script into a Custom module. Joomla’s editors (TinyMCE) and text filters commonly strip <script> tags unless filtering is relaxed for your user group, and a module only loads on pages where it’s assigned. A template or a dedicated “custom code” extension is more reliable and loads on every page.
Caching and optimization
Joomla’s System – Page Cache plugin caches HTML, which is fine — the snippet is in the HTML. Make sure any optimization extension doesn’t combine or defer pusharoo.js in a way that breaks it, and that your CDN never caches /sw.js for long.
Announce new articles automatically
Joomla can publish an RSS or Atom feed for a category or blog menu item (append ?format=feed&type=rss to the menu item URL). Add that feed in Pusharoo under Integrations → Add a feed: new articles become notifications automatically, or drafts for an editor to approve. Only posts published after you add the feed are sent.
Extension vs. snippet
| Push extension | Snippet in template | |
|---|---|---|
| Install | Install package, configure | Upload one file, paste one line |
| Updates | Extension updates to track | Nothing on your site to update |
| Cost | Varies by vendor and plan | Free with Pusharoo |
Some vendors (PushAlert, for example) publish a Joomla plugin; it’s convenient if you’re using that vendor.
Test checklist
- Open
https://yoursite.com/sw.js— you should see JavaScript, not a 404 or your theme’s error page. - Open the site in Chrome, wait for the prompt and allow twice.
- Check that the subscriber count rises in the dashboard, then send yourself a test.
- Repeat on Android, and on iPhone after adding the site to the Home Screen (testing guide).
Questions
Is there a free Joomla push notification extension?
Several vendors offer plugins tied to their service. With Pusharoo you don’t need an extension: a root file and a line in your template are enough, and the service is free.
Where is the Joomla root folder?
It’s the folder that contains configuration.php, index.php and the administrator folder.
Will this work on Joomla 3?
The same idea applies (root file plus template edit), but Joomla 3 is end-of-life; upgrade for security.
Do I need to change Joomla’s .htaccess?
Not for the file itself. You may add cache headers for sw.js in the same .htaccess on Apache.
Can I send a notification when an article is published?
Yes: add the category or blog feed to Pusharoo’s RSS-to-push, automatic or as drafts.
Keep reading
Web push for WordPress and WooCommerce
Upload sw.js, paste one line, exclude it from caching. Works with WooCommerce too.
Web push notifications for Drupal
sw.js in the docroot (often web/), an external theme library with async, Asset Injector, caching and RSS.
Push notifications for publishers and blogs
What to push, breaking news vs. digests, frequency, segments and growing loyal returning readers.
Browser push notifications: who supports what
Support table for Chrome, Edge, Firefox, Safari, Opera and Samsung Internet — desktop, Android and iPhone.
More in Platforms: Web push on Shopify: what works, honestly · WooCommerce push notifications: setup and playbook · Magento 2 push notifications · Web push on Wix, Squarespace and Webflow · Web push notifications on BigCommerce · Web push notifications for PrestaShop · Web push notifications for Ghost blogs · All guides
Free for life. No limits.
Unlimited subscribers, campaigns and automations. No badges. About five minutes to install.