Widget Setup Guide
Step-by-step guide to add the email collection widget to your website.
Email Collection Widget Setup
Learn how to embed our email signup widget on your website to start collecting subscribers.
Quick Setup
Step 1: Get Your Widget Code
- Log into your newsletter dashboard
- Navigate to Settings → Widget
- Copy your unique widget script
Step 2: Add the Base Script
Add this script to your website's HTML, preferably before the closing </body> tag:
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://yourdomain.com/newsletter-widget.js";
js.setAttribute('data-newsletter-id', 'YOUR_NEWSLETTER_ID');
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'newsletter-widget'));
</script>Important: Replace https://yourdomain.com with your actual domain name and YOUR_NEWSLETTER_ID with your newsletter ID from the dashboard.
Step 3: Add Widget Container
Place this HTML where you want the signup form to appear:
<div id="newsletter-signup"></div>Widget Styles
Choose from different pre-built styles:
Minimal Style (Default)
<div id="newsletter-signup" data-style="minimal"></div>Clean, simple input and button.
Card Style
<div id="newsletter-signup" data-style="card"></div>Elevated card design with shadow.
Inline Style
<div id="newsletter-signup" data-style="inline"></div>Horizontal layout for sidebars.
Customization Options
Colors and Text
<div id="newsletter-signup"
data-style="minimal"
data-button-color="#0066cc"
data-button-text-color="#ffffff"
data-placeholder="Your email address"
data-button-text="Join Newsletter"
data-success-message="Thanks for subscribing!">
</div>Available Attributes
| Attribute | Description | Default |
|---|---|---|
data-style | Widget style (minimal, card, inline) | minimal |
data-button-color | Button background color | #0066cc |
data-button-text-color | Button text color | #ffffff |
data-placeholder | Input placeholder text | Enter your email |
data-button-text | Button text | Subscribe |
data-success-message | Success message after signup | Thank you for subscribing! |
Platform-Specific Instructions
WordPress
- Theme Files: Add the script to your theme's
footer.phpfile - Widget Areas: Use a Custom HTML widget in your sidebar
- Page Builder: Add as HTML/Code block in Elementor, Gutenberg, etc.
Shopify
- Theme Files: Add to
theme.liquidbefore</body> - Pages: Use HTML content blocks
- Product Pages: Add to product description templates
Squarespace
- Code Injection: Add script to Footer Code Injection
- Pages: Use Code Blocks for widget containers
- Templates: Add to template files via Developer Mode
Webflow
- Project Settings: Add script to Footer Code
- Pages: Use Embed components for widget containers
- CMS: Add to CMS template pages
Advanced Configuration
Multiple Widgets
You can have multiple widgets on the same page:
<!-- Header widget -->
<div id="newsletter-signup-header" data-style="inline"></div>
<!-- Sidebar widget -->
<div id="newsletter-signup-sidebar" data-style="card"></div>
<!-- Footer widget -->
<div id="newsletter-signup-footer" data-style="minimal"></div>Custom CSS
Override default styles with your own CSS:
#newsletter-signup {
max-width: 400px;
margin: 20px auto;
}
#newsletter-signup input {
border-radius: 8px;
border: 2px solid #e1e5e9;
}
#newsletter-signup button {
border-radius: 8px;
font-weight: 600;
}Event Callbacks
Listen for widget events:
window.addEventListener('newsletter-signup-success', function(event) {
console.log('New subscriber:', event.detail.email);
// Track conversion in analytics
gtag('event', 'newsletter_signup', {
'email': event.detail.email
});
});
window.addEventListener('newsletter-signup-error', function(event) {
console.log('Signup error:', event.detail.error);
});Testing Your Widget
Verification Checklist
- Script loads without errors (check browser console)
- Widget appears in the correct location
- Form accepts valid email addresses
- Success message displays after submission
- Subscribers appear in your dashboard
- Widget is responsive on mobile devices
Common Issues
Widget doesn't appear:
- Check that the script is loaded
- Verify your user ID is correct
- Ensure the container element exists
Form doesn't submit:
- Check browser console for JavaScript errors
- Verify network connectivity
- Ensure CORS is properly configured
Styling issues:
- Check for CSS conflicts
- Use browser dev tools to inspect elements
- Try different widget styles
Analytics Integration
Google Analytics
Track signups as conversions:
window.addEventListener('newsletter-signup-success', function(event) {
gtag('event', 'conversion', {
'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL',
'value': 1.0,
'currency': 'USD'
});
});Facebook Pixel
Track newsletter signups:
window.addEventListener('newsletter-signup-success', function(event) {
fbq('track', 'Lead', {
content_name: 'Newsletter Signup'
});
});Support
Need help with widget setup? Contact our support team with:
- Your website URL
- Widget configuration details
- Any error messages from browser console