Improve Your Website’s Engagement with One-Click Social Media Sharing

Social media sharing allows your community members to easily share your website content on many of the social media platforms – or directly to their contacts – which not only enhances its visibility, but also increases user engagement.
Rather than needing to copy and paste URLs from your website into their social media accounts, thoughtful mission-driven organizations ensure that their community members can click just one button to easily share their content.
Here’s how to add one-click social media share links to your website.
How Social Sharing Links Work
Most social media platforms provide a URL where a GET
request should be submitted, along with query parameters appended to the end of the URL (in a name=value
format).
These parameters contain additional information about the webpage being shared, like the URL, page title, description, and more. The platform uses the submitted URL and parameters to properly show the content when displayed.
Each social media platform handles this slightly differently; let’s look at a few of the major ones.
One-Click Sharing to Facebook
There are two ways to share content to Facebook; one complicated and one relatively easy.
If you want to submit GET
requests for sharing, use this URL:
https://www.facebook.com/dialog/share
However, in order to use this method, Facebook requires you to register a developer account and create a unique App ID (which is then appended to the URL).
The simpler method, which doesn’t require registration, is to use this URL:
https://www.facebook.com/sharer.php
It accepts only one parameter – named “u” – where you should include the URL of the page to be shared.
https://www.facebook.com/sharer.php?u=[Post URL]
One-Click Sharing to X
X (formerly Twitter) uses this URL to share content on their platform:
https://x.com/intent/tweet
This URL accepts four parameters:
- url: The URL of the webpage to be shared
- text: Some text to include in the tweet
- hashtags: Any number of hashtags
- via: To attribute the post to a X account
So, if you want to create a one-click link using all of these parameters, it would look like this:
https://x.com/intent/tweet?url=[Post URL]&text=[Post Title]&hashtags=[Add hashtags here]&via=[Name of associated X account]
There’s a lot more information about this setup in the X developer documents, which you can find here.
One-Click Sharing to LinkedIn
LinkedIn provides this URL for sharing content on their platform:
https://www.linkedin.com/sharing/share-offsite/
It accepts four parameters:
- url: The URL of the webpage to be shared
- title: The title of the shared webpage
- summary: A description of the webpage
- source: The source of the content
Here’s what a built out URL looks like using all of the parameters.
https://www.linkedin.com/sharing/share-offsite/?url=[Post URL]&title=[Post Title]&source=[source name]&summary=[summary of page]
If only the URL is provided, LinkedIn will pull in the “og:title” and “og:description” social metadata values for the “title” and “summary” parameters.
One-Click E-mail Sending
E-mail share links can be created by using the mailto:
prefix, which accepts the following five parameters:
- Any email address(es) (multiples separated by a comma) added directly after the prefix will auto fill the “To” field, which specifies the recipient’s email address
- cc: Any email address(es) assigned to the parameter will populate the “CC” (carbon copy) field
- bcc: Any email address(es) assigned to the parameter will populate the “BCC” (blind carbon copy) field
- subject: The value assigned to the parameter will populate the “Subject” line of the email
- body: The value assigned will populate the main content of the email
Here’s what an email link looks like:
mailto:[email address goes here]?subject=[subject line goes here]&body=[Post URL]
For the purpose of this example, we did not include the “cc” and “bcc” fields, but the idea is the same as the other parameters.
Ensuring the Correct Data is Shared
It’s easy to create any of these one-click social media sharing tools – just add it as a value for the href
attribute in a link – but how can you make sure that all of the correct information is shared?
If the information isn’t directly added as a parameter to your social media share link (like the URL or title), the platform will pull what it needs from your site’s open graph fields. For example, if the platform shows images with shared content, then it will look at your open graph images to display the correct fields.
Make sure that information is correct – spend the time doing it right – and your content will look great when shared online.
If you need help implementing social share links or for any other digital marketing needs, reach out to us.