Skip to content
Platforms · 6 min read

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.

Updated By the Pusharoo team
In short
  • 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

  1. Go to System → Site Templates, open your template (for example Cassiopeia) and click Create Child Template.
  2. Assign the child template as the default style.
  3. In the child template, create or override index.php and paste the snippet before </head>:
    <script src="https://pusharoo.com/sdk/pusharoo.js" data-site="pk_your_site_key" async></script>
  4. 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 extensionSnippet in template
InstallInstall package, configureUpload one file, paste one line
UpdatesExtension updates to trackNothing on your site to update
CostVaries by vendor and planFree with Pusharoo

Some vendors (PushAlert, for example) publish a Joomla plugin; it’s convenient if you’re using that vendor.

Test checklist

  1. Open https://yoursite.com/sw.js — you should see JavaScript, not a 404 or your theme’s error page.
  2. Open the site in Chrome, wait for the prompt and allow twice.
  3. Check that the subscriber count rises in the dashboard, then send yourself a test.
  4. 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.

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.