How to Collect Email Leads from Twitter in a Google Spreadsheet

One of the best features of Twitter that is relatively unknown to most users is their Lead Generation cards. Your tweet, see live example, will have a button and when another Twitter user clicks the button, their email address is sent to your application (which happens to be a Google spreadsheet in this case).

Whether you are a small website owner or an event organizer, you can use these Lead Generation cards to easily collect email addresses from Twitter users who may be interested in your product. For instance, Twitter users can subscribe to your email newsletter with a click without leaving the Twitter website. Event organizers can use Twitter’s Lead Generation Cards to capture email addresses of people who may be interested in attending an upcoming event.

Integrate Twitter Lead Generation Cards with Google Sheets

The Lead Generation Cards are available to all Twitter users who have a Twitter Ads account - get yours at ads.twitter.com - and there are no costs involved. This tutorial explains how you can create a Twitter Lead generation card and capture all the email addresses in a Google Spreadsheet. Other than the email address, the screen name and the full name of the Twitter user is also collected in the spreadsheet. Let’s get started:

1. Prepare the Google Spreadsheet

The first thing we need to do is create a Google Spreadsheet that will be used to store the details of Twitter users. This sheet will internally contain a Google Script to connect the sheet and your Twitter card.

This is easy. Click here to make a copy of the Google Sheet in your Google Drive. Once the copy is created, go to the Tools menu in the sheet and choose Script Editor. Here choose Start from the Run menu and follow the wizard to authorize the script. Next choose Deploy Web App from the Publish menu.

Twitter Leads - Deploy Google App

On the Deploy screen (see the screenshot above), click the Save New Version button and change the access permission from Only Myself to Anyone, even anonymous. Click the Deploy button and you’ll get a script URL that you should note down somewhere as we’ll require it in the next step.

2. Create the Twitter Card for Email Leads

Go to your Twitter Ads dashboard, click on Creatives in the navigation bar and choose Cards. Here click the big blue “Create Lead Generation Card” to create a new Twitter Card. You can add a description to your card, upload a 800x200 pixel image that will show up with the tweet and give your button a name (Call to Action).

Next expand the Data Settings group and paste the Google Script App URL (that you generated in the previous step) in the Submit URL field. Choose the HTTP method as POST from the drop-down, agree to the terms and hit submit to create your first Twitter card.

That’s it. You can put the Card’s URL - see example - in a tweet and your Twitter followers will be able to share their email address with a click that is directly saved in your Google Sheet.

Twitter Card for Email Leads

Also see: Save #Hashtag Tweets in Google Sheets

If you are web developer, you can further enhance the Google Script to do even more advanced stuff. For instance, if you have published a premium PDF report, you can allow Twitter users to download the report after they choose to share their email address. The script will trigger as soon as someone submits the email address and it will send a mail to the user with the PDF attachment using the Gmail API.

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

0

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.