Embedding Testimonials on Your Website: Developer's Guide
Complete technical guide to embedding testimonial widgets on WordPress, Webflow, custom sites, and other platforms with code examples and best practices.
Embedding Testimonials on Your Website: Developer's Guide
You've collected testimonials. Now you need to display them on your website. This guide covers everything from simple embeds to advanced customization across all major platforms.Quick Start: Universal Embed Code
GetProofz provides a simple script tag that works everywhere:
That's it. The widget automatically:
Let's go deeper.
---
Platform-Specific Guides
1. WordPress
#### Method A: Widget Plugin (Easiest)
Done! Widget appears on all pages where sidebar is visible.
#### Method B: Shortcode (Flexible)
Create custom shortcode in functions.php:
function getproofz_widget_shortcode($atts) {
$atts = shortcode_atts(array(
'project' => '',
'layout' => 'carousel',
'limit' => '5',
), $atts);
return '
';
}
add_shortcode('getproofz', 'getproofz_widget_shortcode');
Usage in posts/pages:
[getproofz project="your-slug" layout="grid" limit="6"]
#### Method C: Gutenberg Block (Advanced)
Create custom Gutenberg block:
// src/getproofz-block.js
import { registerBlockType } from '@wordpress/blocks';
registerBlockType('getproofz/testimonials', {
title: 'GetProofz Testimonials',
icon: 'star-filled',
category: 'widgets',
attributes: {
projectSlug: { type: 'string' },
layout: { type: 'string', default: 'carousel' },
},
edit: (props) => {
return (
props.setAttributes({ projectSlug: e.target.value })}
/>
{/* Layout selector */}
);
},
save: (props) => {
return (
);
},
});
Advantages:
2. Webflow
#### Embed Widget
Then style .testimonials-section in Webflow designer.
Note: Webflow doesn't allow external script in normal embeds. Use Page Settings → Custom Code (in ) for the script tag.
---
3. Shopify
#### Add to Theme Option A: Theme Editortemplates/page.liquid){% comment %} GetProofz Testimonials {% endcomment %}
{% comment %} Load script once per page {% endcomment %}
{% unless content_for_header contains 'proof.js' %}
{% endunless %}
Add setting to theme settings:
In config/settings_schema.json:
{
"name": "GetProofz",
"settings": [
{
"type": "text",
"id": "getproofz_project_slug",
"label": "Project Slug",
"info": "Your GetProofz project slug"
}
]
}
Now theme users can configure project slug in theme settings.
---
4. Squarespace
Styling:
Squarespace auto-styles based on site theme. To override:
---
5. React / Next.js
#### React Component// components/TestimonialsWidget.tsx
'use client' // Next.js 13+ App Router
import { useEffect } from 'react'
interface Props {
projectSlug: string
layout?: 'carousel' | 'grid' | 'list'
limit?: number
theme?: 'light' | 'dark'
}
export function TestimonialsWidget({
projectSlug,
layout = 'carousel',
limit = 5,
theme = 'light'
}: Props) {
useEffect(() => {
// Load script if not already loaded
if (!document.getElementById('getproofz-script')) {
const script = document.createElement('script')
script.id = 'getproofz-script'
script.src = 'https://getproofz.com/widget/v1/proof.js'
script.defer = true
document.body.appendChild(script)
}
// Reinitialize widget when props change
if (window.GetProofz) {
window.GetProofz.init()
}
}, [projectSlug, layout, limit])
return (
)
}
Usage:
// app/page.tsx
import { TestimonialsWidget } from '@/components/TestimonialsWidget'
export default function HomePage() {
return (
Customer Testimonials
)
}
#### SSR Considerations
Widget loads client-side (requires window object). For Next.js:
import dynamic from 'next/dynamic'
const TestimonialsWidget = dynamic(
() => import('@/components/TestimonialsWidget'),
{ ssr: false }
)
---
6. Vue.js / Nuxt
#### Vue Component
Usage:
---
Advanced Customization
Layout Options
GetProofz supports 3 layouts: #### 1. Carousel (Default)
Filtering & Sorting
#### Filter by Rating
Show only 4-5 star testimonials.
#### Filter by Tag
Show testimonials with specific tags.
#### Sort Order
Theming
#### Built-in Themes
#### Custom CSS
Override widget styles:
/* Target widget container */
#getproofz-widget {
--testimonial-bg: #f9f9f9;
--testimonial-text: #333;
--testimonial-border: #ddd;
--testimonial-radius: 8px;
}
/* Individual testimonial cards */
.getproofz-testimonial {
background: var(--testimonial-bg);
color: var(--testimonial-text);
border: 1px solid var(--testimonial-border);
border-radius: var(--testimonial-radius);
padding: 24px;
}
/* Customer photos */
.getproofz-photo {
width: 64px;
height: 64px;
border-radius: 50%;
}
/* Customer name */
.getproofz-name {
font-weight: 600;
font-size: 16px;
}
/* Company/title */
.getproofz-company {
font-size: 14px;
color: #666;
}
/* Star rating */
.getproofz-rating {
color: #ffb800; /* Star color */
}
JavaScript API
For advanced control:// Initialize widget programmatically
GetProofz.init({
container: '#getproofz-widget',
project: 'your-slug',
layout: 'grid',
limit: 6,
onLoad: (testimonials) => {
console.log('Loaded testimonials:', testimonials)
},
onError: (error) => {
console.error('Widget error:', error)
}
})
// Refresh widget (fetch new testimonials)
GetProofz.refresh()
// Destroy widget
GetProofz.destroy()
---
Performance Optimization
Lazy Loading
Widget automatically lazy-loads by default, but you can control it:
Caching
Testimonials are cached in browser for 1 hour. To force refresh:
Image Optimization
Photos are automatically:
Lower quality = faster load, but slightly worse photos.
---
Troubleshooting
Widget Not Showing
Check:data-project="YOUR_PROJECT_SLUG"id="getproofz-widget"
Logs widget initialization to console.
Styling Issues
Common fixes:/* Widget too wide */
#getproofz-widget {
max-width: 1200px;
margin: 0 auto;
}
/* Widget overlapping other content */
#getproofz-widget {
position: relative;
z-index: 1;
}
/* Photos not loading */
.getproofz-photo {
object-fit: cover; /* Ensure photos fill circle */
}
Performance Issues
If widget loads slowly:data-limit="3" instead of data-limit="20"data-lazy="true"data-image-quality="medium"Security Best Practices
Content Security Policy (CSP)
If using CSP headers, allow GetProofz:Content-Security-Policy:
script-src 'self' https://getproofz.com;
img-src 'self' https://getproofz.com https://cdn.getproofz.com;
connect-src 'self' https://api.getproofz.com;
HTTPS
Widget requires HTTPS in production. Local development (localhost) works with HTTP.Sanitization
All testimonial content is sanitized server-side to prevent XSS. No client-side sanitization needed. ---Conclusion
Embedding GetProofz testimonials is simple: Basic embed:
Platform-specific:
Frequently Asked Questions
Will the widget slow down my website?
No. The GetProofz widget is optimized for performance: (1) Script loads asynchronously with `defer` attribute, (2) Testimonials lazy-load when scrolled into view, (3) Images are optimized and served via CDN, (4) Total size is ~15KB gzipped. Most sites see <100ms load time impact.
Can I customize the widget design to match my brand?
Yes! You have full control via CSS. GetProofz exposes CSS classes for all elements (cards, photos, names, ratings). Use CSS variables for quick theming or write custom CSS for complete control. The widget adapts to your site's fonts and colors automatically.
Does the widget work on mobile devices?
Yes, fully responsive. The grid layout automatically adjusts columns (3 on desktop, 2 on tablet, 1 on mobile). Carousel supports touch/swipe gestures. Images are optimized for mobile bandwidth. The widget is tested on iOS, Android, and all major browsers.
Can I show different testimonials on different pages?
Yes. Use different project slugs or filter by tags. For example, show "feature-A" tagged testimonials on Feature A page, "pricing" tagged testimonials on pricing page. You can also use JavaScript API to dynamically change filters based on current page.
What happens if GetProofz is down?
The widget degrades gracefully. If the API doesn't respond, the widget container remains empty (no error messages shown to users). Your site continues to function normally. We have 99.9% uptime SLA and CDN redundancy. For critical applications, you can implement a fallback using static testimonials.
Can I embed the same widget multiple times on one page?
Yes, but each widget needs a unique ID. Use `id="getproofz-widget-1"`, `id="getproofz-widget-2"`, etc. Or use different project slugs to show different testimonial sets. The script tag only needs to be included once per page.