Social share buttons are essential for any website looking to grow organically. They make it easy for visitors to share your content across social networks, potentially reaching thousands of new people with a single click.
Key Benefits:
In this comprehensive guide, you'll learn how to add social share buttons to your website, regardless of your platform or technical skill level.
TokWork is the easiest and most powerful way to add social share buttons. Unlike traditional solutions, it includes influencer rewards to maximize sharing.
https://yoursite.com)Copy the installation code from your dashboard:
<!-- Add this before closing </body> tag -->
<script
src="https://js.tokwork.com/loader.js"
data-website-id="your-unique-id"
data-website-domain="yoursite.com"
async
></script>
Installation by Platform:
</body> tag<!DOCTYPE html>
<html>
<head>
<title>Your Website</title>
</head>
<body>
<!-- Your content -->
<!-- TokWork Script -->
<script
src="https://js.tokwork.com/loader.js"
data-website-id="your-unique-id"
async
></script>
</body>
</html>
Option A: Using a Plugin
Option B: Edit theme files
footer.php<?php wp_footer(); ?><!-- TokWork Script -->
<script
src="https://js.tokwork.com/loader.js"
data-website-id="your-unique-id"
async
></script>
<?php wp_footer(); ?>
</body>
</html>
theme.liquid</body><!-- TokWork Script -->
<script
src="https://js.tokwork.com/loader.js"
data-website-id="your-unique-id"
async
></script>
</body>
</html>
For Next.js, add to _document.js or _app.js:
import Script from 'next/script'
export default function MyApp({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<Script
src="https://js.tokwork.com/loader.js"
data-website-id="your-unique-id"
strategy="lazyOnload"
/>
</>
)
}
For React, add to index.html:
<body>
<div id="root"></div>
<script
src="https://js.tokwork.com/loader.js"
data-website-id="your-unique-id"
async
></script>
</body>
Troubleshooting:
If you want full control and don't need analytics, you can create custom share buttons with HTML.
<!-- Twitter Share Button -->
<a
href="https://twitter.com/intent/tweet?text=Check%20this%20out!&url=https://yoursite.com"
target="_blank"
rel="noopener noreferrer"
class="share-button twitter"
>
Share on Twitter
</a>
<!-- Facebook Share Button -->
<a
href="https://www.facebook.com/sharer/sharer.php?u=https://yoursite.com"
target="_blank"
rel="noopener noreferrer"
class="share-button facebook"
>
Share on Facebook
</a>
<!-- LinkedIn Share Button -->
<a
href="https://www.linkedin.com/sharing/share-offsite/?url=https://yoursite.com"
target="_blank"
rel="noopener noreferrer"
class="share-button linkedin"
>
Share on LinkedIn
</a>
.share-button {
display: inline-block;
padding: 10px 20px;
margin: 5px;
border-radius: 5px;
color: white;
text-decoration: none;
font-weight: bold;
transition: opacity 0.3s;
}
.share-button:hover {
opacity: 0.8;
}
.share-button.twitter {
background-color: #1DA1F2;
}
.share-button.facebook {
background-color: #1877F2;
}
.share-button.linkedin {
background-color: #0A66C2;
}
// Get current page info
const pageUrl = encodeURIComponent(window.location.href);
const pageTitle = encodeURIComponent(document.title);
// Update share links
document.querySelectorAll('.share-button').forEach(button => {
const platform = button.classList[1]; // twitter, facebook, etc.
if (platform === 'twitter') {
button.href = `https://twitter.com/intent/tweet?text=${pageTitle}&url=${pageUrl}`;
} else if (platform === 'facebook') {
button.href = `https://www.facebook.com/sharer/sharer.php?u=${pageUrl}`;
} else if (platform === 'linkedin') {
button.href = `https://www.linkedin.com/sharing/share-offsite/?url=${pageUrl}`;
}
});
Cons of Custom Buttons:
Optimal Positions:
Avoid:
Do:
Don't:
Pre-fill Share Text:
<!-- Good: Specific, engaging text -->
<a href="https://twitter.com/intent/tweet?text=I%20just%20discovered%20this%20amazing%20tool%20for%20social%20sharing!&url=https://yoursite.com">
Share
</a>
<!-- Bad: Generic text -->
<a href="https://twitter.com/intent/tweet?url=https://yoursite.com">
Share
</a>
Include Images:
<meta property="og:title" content="Your Page Title" />
<meta property="og:description" content="Engaging description" />
<meta property="og:image" content="https://yoursite.com/image.jpg" />
<meta property="og:url" content="https://yoursite.com" />
Mobile-Specific Considerations:
// Use native share API on mobile
if (navigator.share) {
button.addEventListener('click', async () => {
try {
await navigator.share({
title: document.title,
url: window.location.href
});
} catch (err) {
console.log('Share failed:', err);
}
});
}
Set up automatic rewards for influencers who share your content:
// Configure in TokWork dashboard
{
"rewards": {
"perView": 0.01, // $0.01 per view
"perLike": 0.05, // $0.05 per like
"perShare": 0.10, // $0.10 per share
"perClick": 0.02 // $0.02 per click
},
"minimumPayout": 10.00 // Minimum $10 for payout
}
TokWork automatically generates personalized content for each influencer:
Track everything in your dashboard:
Beginner Goals (Month 1-3):
Intermediate Goals (Month 4-6):
Advanced Goals (Month 7+):
Q: How many social share buttons should I add? A: 3-5 buttons for your most relevant platforms. More isn't always better.
Q: Do social share buttons slow down my website? A: TokWork's async loading has minimal impact (<0.1s). Avoid platforms with heavy tracking scripts.
Q: Should I reward people for sharing? A: Yes! Studies show incentivized sharing increases share rates by 5-10x.
Q: Which platforms should I include? A: Depends on your audience. B2B: LinkedIn, Twitter. B2C: Facebook, Instagram, Pinterest.
Q: How do I track ROI from social sharing? A: Use TokWork's built-in analytics or UTM parameters with Google Analytics.
Q: Can I customize the button design? A: Yes, TokWork allows full customization to match your brand.
Q: Do I need coding skills? A: No! TokWork is copy-paste simple. Custom solutions require HTML/CSS knowledge.
Q: How much should I budget for rewards? A: Start with $50-100/month. Most see 5-10x ROI.
Now that you know how to add social share buttons, here's what to do next:
Ready to turn social sharing into your #1 growth channel?
Adding social share buttons to your website is essential for organic growth. While you can create custom buttons with HTML, using a platform like TokWork gives you:
The choice is clear: invest 5 minutes with TokWork and turn social sharing into your most powerful growth channel.