How to track your Instagram followers over time with Google Sheets Scripts
Update: I’m indebted to @Juliandev (Github link) who has rewritten the script from scratch after the old one stopped working.
While some tools have sprung up that allow you to track follower count over time, none of them give you direct access to the data so you can’t add it to Google Sheets. 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 “followers”, “following”, “Media count”, “Likes”, “Comments”, “Engagement Ratio” in cells A1 to F1
- 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
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.
The current version is provided by @JulianDev on Github. Damian Bast provided the previous version of the script based after mins stopped working when Instagram changed their API. Thanks both for your contributions!