Prerequisites
Before using the Goal Bar Widget, make sure you’ve installed the Widgets library.Quick Setup
The fastest way to add a goal bar widget:- Visit your Givebutter Dashboard
- Select your campaign
- Navigate to Sharing > Widgets
- Choose Goal Bar as the widget type
- Customize the appearance
- Copy the generated code
- Paste it where you want the goal bar to appear on your site
Manual Setup
For greater control, you can manually create goal bar widgets using the<givebutter-goal-bar> tag:
Configuration Options
Customize your goal bar’s appearance by adding attributes to the<givebutter-goal-bar> element:
Required Attributes
| Attribute | Description | Example |
|---|---|---|
campaign | Your campaign code (find it in your campaign URL) | my-campaign |
Styling Attributes
| Attribute | Description | Default | Type |
|---|---|---|---|
color | Color of the progress bar fill | #FF8A00 | Hex Color Code |
background-color | Background color of the unfilled portion | #E5E7EB | Hex Color Code |
text-color | Color of text labels (amount, percentage) | #111827 | Hex Color Code |
height | Height of the progress bar in pixels | 12 | Number |
border-radius | Corner roundness of the bar | 8 | Number |
show-percentage | Display percentage complete | true | Boolean |
show-amount | Display amount raised vs goal | true | Boolean |
show-goal-only | Only show goal amount (not current amount) | false | Boolean |
animate | Animate the bar fill on page load | true | Boolean |
Examples
- Default Style
- Brand Colors
Use Cases & Placement
Campaign Landing Pages
Campaign Landing Pages
Place the goal bar prominently near the top of your campaign page to immediately show progress:
Email Campaigns
Email Campaigns
Embed goal bars in email newsletters to show campaign momentum (ensure your email client supports
custom HTML elements): ```html
We’re 73% of the way to our goal!
Help us reach 100% by donating today!
Website Headers & Banners
Website Headers & Banners
Layout Patterns
Full-Width Banner
Sidebar Widget
Inline with Content
Psychology & Best Practices
The Momentum Effect
The Momentum Effect
Goal bars work best when you’ve already made significant progress. Consider:
- 30-70% complete: Optimal range showing momentum and attainability
- Under 30%: May discourage donors; emphasize early supporter benefits
- Over 80%: Creates urgency; highlight “almost there” messaging
- 100%+: Show “stretch goals” or new milestones to maintain momentum
Strategic Goal Setting
Strategic Goal Setting
Set realistic, achievable goals: - Start with a lower “public goal” you’re confident hitting -
Create stretch goals to maintain excitement after hitting initial target - Consider displaying
multiple campaign bars for different projects - Update goals mid-campaign if you significantly
exceed expectations
Placement Matters
Placement Matters
Where you place the goal bar affects conversion: - Above the fold: Immediate visibility, best
for urgent campaigns - After compelling story: Build emotional connection first - Near
donation button: Provides social proof at decision point - Multiple locations: Repeat on
long pages (header, mid-content, footer)
Color Psychology
Color Psychology
Choose colors that align with your message: - Blue (#3B82F6): Trust, stability,
professionalism - Green (#10B981): Growth, success, money - Purple (#8B5CF6): Creativity,
inspiration, luxury - Red/Orange (#DC2626): Urgency, passion, action - Brand colors:
Always a safe choice for consistency
Combining with Other Widgets
Combining with Other Widgets
Goal bars work great alongside other widgets:
Real-Time Updates
Goal bars automatically update in real-time:- Live Progress: Updates instantly when donations come in
- No Page Refresh: Uses Givebutter’s real-time API
- Accurate Counts: Shows current totals including offline donations (if synced)
- Cache Handling: Smart caching prevents excessive API calls
Performance Note: Goal bars check for updates every 60 seconds by default. The widget is
optimized to minimize impact on page performance.
Accessibility
The Goal Bar Widget is built with accessibility in mind:- ✅ ARIA labels for screen readers
- ✅ Semantic HTML structure
- ✅ Sufficient color contrast ratios
- ✅ Keyboard navigation support
- ✅ Respects user motion preferences (reduced animation)
Troubleshooting
Goal bar shows $0 or 0%
Goal bar shows $0 or 0%
Common causes:
- Campaign hasn’t received any donations yet
- Campaign goal not set in Dashboard
- Campaign is not published/active
- Incorrect campaign code
Goal bar doesn't fit container
Goal bar doesn't fit container
The goal bar is responsive and will fill its container width. If it appears too wide or narrow:
- Wrap it in a container with max-width
- Use CSS to control the parent element’s width
- Check for conflicting CSS styles
Colors not displaying correctly
Colors not displaying correctly
Ensure you’re using proper hex color format: - ✅ Correct:
color="#3B82F6" - ❌ Incorrect:
color="3B82F6" (missing #) - ❌ Incorrect: color="blue" (use hex codes, not color names)Progress not updating
Progress not updating
If the progress appears stuck:
- Clear your browser cache
- Check if your campaign recently received donations
- Verify offline donations are synced in Dashboard
- Wait 60 seconds for the automatic refresh