How to automate your social media posts using Google Calendar and Zapier

Distributing content is the “marketing arm” of content marketing. Here’s a step by step guide to posting your content automatically on social media platforms, like Facebook, Twitter and LinkedIn.

There’s an old Chinese saying of ‘fragrant wine fears no dark alley’ (“酒香不怕巷子深”), meaning that if your goods are of high-quality, then they need no advertising. However, in this age of information overload, it’s no longer the case. To stand out amongst the abundance of information we’re exposed to in our daily lives, we have to amplify our brand’s reach and expand the audience through various digital platforms like Facebook, Twitter, Instagram, and LinkedIn.

However, managing multiple social media channels is not an easy job. We need to spend time and efforts to maintain each channel on a regular basis. In particular, sharing the same content on different channels makes this work trivial and time-consuming. How can we solve this problem? Automation. In this article, we’ll talk about implementing automatic posting on social media channels by using Google Calendar and Zapier.

process illustration

Before jumping into the technical implementation, let‘s quickly go through your social media strategy - a necessary first step before setting up automation.

Create your social media strategy accordingly

First things first, you should know what content you want to automate sharing on social media platforms. For instance, Wiredcraft publishes blog posts on wiredcraft.com on a weekly basis. So we want to share our posts on other channels on a regular basis as well. Here is a content format for social media:

Description + Hashtags + Link

Template
How and why we use Terraform to spawn Kubernetes clusters on AliCloud. #DevOps #performance #Kubernetes #AliCloud #Terraform
https://wiredcraft.com/blog/containers-at-scale-on-chinese-clouds

The second step is to choose the channels you want to use: Facebook, Twitter, LinkedIn, etc. Last but not the least, create a content calendar which includes channels, the days and specific times for posting. Do some research and get to know the best practices for each channel.

RSS serves as the data source

A mechanism is needed to represent the blog posts as a feed list and inform subscribers when a new feed is added to the list. RSS protocol is perfectly suited to this case.

We created a XML file called https://wiredcraft.com/feed.xml, which loops over our posts and generates one item containing the necessary fields.

<item>
  <title>
    Growing your product sense as a non-product manager: Part 1
  </title>
  <link>
    https://wiredcraft.com/blog/growing-your-product-sense-as-a-non-product-manager-part-1/
  </link>
  <description>
    How to grow your product sense? A good product has its own mission.
  </description>
  <pubDate>Tue, 05 Mar 2019 00:00:00 +0800</pubDate>
  <category>strategy</category>
  <category>product sense</category>
  <category>strategy</category>
  <category>wechat</category>
  <category>allen zhang</category>
  <category>product management</category>
  <guid isPermaLink="true">
    https://wiredcraft.com/blog/growing-your-product-sense-as-a-non-product-manager-part-1/
  </guid>
</item>

Zapier is the engine of the automation

Zapier can be viewed as something like a task pipeline. For example, you could say “Hey Zapier, when a new blog post is published on wiredcraft.com, create a tweet about that on next Monday morning, and share that on my Facebook homepage next Tuesday evening”. Zapier will do the rest of the work for you.

What happens under the hood is that we made a Zap in Zapier as per the following:

  • Set the trigger to the previously created RSS feed
  • Authorize Zapier on our social media accounts
  • For each platform, create one action that extracts information from the feed item, and pieces the fields together into a text string like "<description> #<category1> #<category2> <link>"
  • Insert several built-in Delay actions into the pipeline to control the time each post occurs

This is what it looks like:

zapier illustration

Google Calendar visualizes and eases the process

The Zap above seems feasible, but it has its shortcomings:

  • We don’t have a clear overview of the schedule, showing when and what we will post on which platform every day
  • Let’s say we have 3 social media platforms - Twitter, Facebook and LinkedIn - and we plan to share on each platform 4 times. We end up with a very heavy Zap with more than 20 actions whose triggered moments are coupled with each other. That’s a nightmare for maintaining and testing!

So Google Calendar comes to rescue. The idea is that we can replace each action that will happen in the future with a Google Calendar event in the origin Zap. When an event ends, fire another Zap that publishes things on social media.

When the first Zap receives a new post, it bulk creates 12 events immediately. This can be done in the built-in CODE action by setting the output to an array:

var now = new Date(Date.now())
var nextWed = getNextWeekday(now, 3)
var next2Thu = getNextWeekday(nextWed, 4)
var next3Fri = getNextWeekday(next2Thu, 5)
var next4Tue = getNextWeekday(next3Fri, 2)
var dates = [nextWed, next2Thu, next3Fri, next4Tue]
var media = ['Twitter', 'Facebook', 'LinkedIn']
var result = []

for (var medium of media) {
  for (var date of dates) {
    var timestamp = date.setHours(medium === 'LinkedIn' ? 8 : 20)
    
    result.push({
      medium,
      timestamp,
    })
  }
}

output = result

The title of an event is composed of the corresponding platform and the message, separated by a “|”:

google calendar automation illustration

Here we get a bonus. We can edit the event if we want to customize the sharing content.

The second Zap is super easy: when a certain Google Calendar event ends, read the title, extract the platform and the message, then publish it.

Automatically posted on LinkedIn and Twitter

And voilà!

Zifan Jiang
Frontend Developer
Posted on April 09, 2019 in Technology

Share this post

Scan to open in WeChat

Stay tuned

Follow our newsletter or our WeChat account; every other week you'll receive news about what we're up to, our events and our insights on digital products, omnichannel, cross-border ecommerce or whatever the team fancies.

  • Add us on WeChat

  • Subscribe to our newsletter