How to track your Instagram followers over time with Google Sheets Scripts

Instagram is an important channel for the King & McGaw marketing team, and we want to track our engagement KPIs as closely as possible.

The first thing we wanted to track was our follower count over time. While some tools have sprung up that allow you to do this, none of them give you direct access to the data so you can’t add it to Google Sheets.

Google Apps Script to the rescue!

Luckily, the problem was easily solved with a simple Google Apps Script, which you can have up and running in 2 minutes. Here’s how!

  • Create a new Google Sheet, and create headings “date” and “followers” in cells A1 and B1
  • Open “Tools > Script Editor”
  • Paste this script and change the variables on lines 2 and 4 to the name of your sheet, and the name of the Instagram account you’d like to target.
  • Save the script (you’ll be prompted to name the project)
  • Open “Run > insertFollowerCount” and when prompted to for authorization choose “Review Permissions” then allow permission on the dialog box

This is supplied courtesy of Damian Bast who built this script based on an earlier version of mine after it stopped working when Instagram changed their API. You can read about that here. Thanks Damian!

Note: It’s possible to track your Twitter followers using this similar script I put together.

If you switch back to your spreadsheet you should have a new row added with today’s date and the number of followers.

Because Instagram’s API doesn’t give access to historical follower counts, you’ll need to run this every day. Thankfully we can automate this.

Running the script on a schedule

  • Open “Edit > Current project’s triggers”
  • Click “No triggers set up. Click here to add one now.” then choose “Time-driven” and “Day timer” and choose a time you’d like the script to run.

You’ll now get a new row added to your spreadsheet every night. Once you’ve collected a week or two worth of data, you’ll be able to make it useful.

Making it useful

For our KPI dashboards we track changes over a specific time period and visualise them in charts. Here is an example that shows last week’s metrics using a sparkline to see if changes are caused by a consistent trend, or a one-time spike.

If you were so inclined (we’re not!), you could also track your competitor’s accounts.

Like what you see? Read about how to tie this all together into automated dashboards.