To collect subscribers on your website, simply add the lightweight AlertMagnet SDK script to your HTML.
Using alertmagnet-sdk.js
Paste the following script tag into the <head> of your website:
<script src="https://push.yourdomain.com/alertmagnet-sdk.js" data-site="YOUR_SITE_TOKEN" async></script>
Replace https://push.yourdomain.com with your AlertMagnet server URL and YOUR_SITE_TOKEN with the token shown in your AlertMagnet dashboard under Websites.
Platform Integration
- WordPress: Use any header script plugin (e.g., WPCode) or paste into your theme's
header.php. - Shopify: In your Shopify Admin, go to Online Store → Themes → Edit code, open
theme.liquid, and insert before</head>. - Next.js / Astro / HTML: Place the script tag in your root HTML layout document.
Triggering Prompts Manually
If you prefer to trigger the subscription prompt from a custom button on your website, use the JavaScript helper:
window.AlertMagnet.prompt();