How To Create A Sharing Link For A Custom Tweet

By Daniel J. Murphy

This is a quick tutorial on how to create a link that opens a new window/tab with a pre-written tweet. This is something you might find on a blog post, with a pre-written tweet you can easily share on your twitter feed. After reading this tutorial you’ll be able to create your own custom link with a custom tweet.

For this tutorial I’m going to show you how to do this using a blog post about Demand Generation from popular startup blogger Tom Tunguz as an example.

The link might look like this: Share this post

Here’s the code for the link. I’m going to use a basic text hyperlink, but you could use a linked image or button for your tweet link.

<a href=”https://twitter.com/intent/tweet?url=http%3a%2f%2fwww.tomtunguz.com%2fimportance-and-mystery-demand-generation%2f&text=Why%20Demand%20Generation%20Can%20Be%20So%20Challenging%20For%20Startups%20via%20@ttunguz&related=ttunguz”>Share this post</a>

which looks like this:

It’s the link in that code that we’re going to work on. Let’s break it down:

Base url:

https://twitter.com/intent/tweet

First query (the url in the tweet):

url=http%3a%2f%2fwww.tomtunguz.com%2fimportance-and-mystery-demand-generation%2f

Because you are putting a link within a link, you can’t just add the URL, otherwise it wouldn’t execute the URL in a browser. So there are symbols used to indicate certain characters in a URL. Here they are:


%3a = a colon :
%2f = a forward slash /

The URL Tom wants shared in the tweet is http://www.tomtunguz.com/importance-and-mystery-demand-generation

Second query (the text of the tweet):

&text=Why%20Demand%20Generation%20Can%20Be%20So%20Challenging%20For%20Startups%20via%20@ttunguz

Again, note that in a URL the %20 indicates a space. Also, Tom is adding his twitter handle in this tweet “@ttunguz” so he’ll be notified when someone shares his work.

Third query (related):

This is actually pretty cool. After you execute the tweet, this will show the twitter user “ttunguz” as a recommended account you should follow (if you don’t already). That is a neat customization that encourages those sharing your work to follow your account.

That’s it. Comment below if you have questions.


Don’t forget to subscribe if you want helpful tech tips and startup marketing insight.


Additional Resources:

https://dev.twitter.com/web/tweet-button

Measure Your Blog’s Growth With A Startup Marketer’s Blog Growth Template
No CMS platform does it quite right. Measuring your blog growth, month-to-month is a vital top level data point for reviewing your marketing performance.
I want this template!