Extensions

Search Extensions

Importing from Facebook with Event Aggregator

Due to restrictions in Facebook’s API, we are not able to provide direct Facebook event imports via Event Aggregator. However, this extension provides a workaround that will allow you to import some events from Facebook.

Once this extension is installed and connected to your Facebook account, you’ll be able to import the following categories of events:

  • Events you have created on your personal Facebook page
  • Events from a Group or Page for which you are an admin
  • Events that you have marked as Interested
  • Events you have RSVP’d to (Going, Maybe, or Can’t Go)

To be clear, this method of importing events is against Facebook’s stated acceptable usage of their API. However, this functionality is nonetheless available to users who have a Facebook Access Token in development mode. We do not expect this to function in the long term as Facebook is likely to close this loophole in their own API.

When Facebook limited their API in the spring of 2018, we followed the new protocols to request that Event Aggregator’s Access Token have permission to access the user_events API. However, our application was denied with no recourse. According to Facebook:

Showing your Page’s events on an external site isn’t a valid user_events use case. The only acceptable use case for user_events is to integrate a person’s events onto their daily planning calendar. Consider using the Page plugin, which doesn’t require App Review, and lets you easily embed and promote your Facebook Page, including its timeline and events.

Despite this restriction, Facebook recently re-opened the ability for developers with an Access Token to get events from pages where they are either the editor or admin. Anyone can get a Facebook Access Token and use it in development mode – without seeking approval – and therefore, can fetch their own events or events they are associated with (see list above).

Installing the Extension

First, make sure you are running The Events Calendar 4.6.24.1 or later. Without the code from that release, this extension won’t work. You’ll also need to have a valid license for Event Aggregator. Next, download the extension from this page and install it as you would any plugin. That will add the new Facebook Dev origin on the Imports page. If you don’t see it there, try clearing your site’s transients via a plugin like Transients Manager.

Getting a Facebook Access Token

You’ll need to complete these steps in order to use the extension.

First, go to https://developers.facebook.com and log in or make a new developer account. Once you’re logged in, go to the upper right hand menu and select My Apps –> Add New App.

Fill out the fields and click Create App ID.

You’ll be redirected to your account’s app dashboard. From the menu on the left, select Settings –> Basic. 

In the App Domains field, enter http://ea.theeventscalendar.com

Next, click the Products + link from the left hand sidebar. Find the Facebook Login listing and click Set Up. 

On the setup page, select Web.

Now click the Settings link under Facebook Login and, without changing anything, save the page.

Keep the Facebook Developer dashboard open in one tab and in another, head to your site and navigate to Events –> Imports. On the New Imports tab, you’ll see a new Origin option available:

Once that’s selected, you’ll be prompted to connect your Facebook account to your WordPress site.

Click the Connect to Facebook Dev link and you’ll be presented with a popup.

To create the necessary connection, you’ll need to fill in the API App fields with the number strings from your Facebook App’s Basic Settings.

Copy the numbers from your Facebook App dashboard into the Configuration popup on your WordPress site.

Copy the numbers into each field and hit the Save App Configuration button. The popup will reload with a red notice.

As we noted above, while this importing from Facebook with an Access Token is possibleit is technically against Facebook’s stated acceptable usage of their API. The notice seen here reflects that policy. However, you do not need to take action here. Click the blue Continue button and you’ll be ready to start importing events via your new Facebook Dev origin.

Importing From Facebook

Once your site is connected to your Facebook Access Token and your account, you can import events from Facebook using the new Facebook Dev origin. You can either imports events from your account or via a URL.

The Import from your account option will fetch events that you created in your personal Facebook account. You can use the Import from URL option to grab events you’ve RSVP’d to, events you have starred as being Interested in, or events from a Page or Group that you’re an admin for. You can also use it to import your personal events individually with the event’s URL.

When importing from a Group, you’ll need to use a URL with the group’s ID number (e.g. www.facebook.com/groups/154659839202/), not the group’s alias. The number can be found on the Manage Group screen. When importing from a page, you can use the page’s main URL containing the page name (e.g. www.facebook.com/testpage/).

Changelog

  • Version 1.0.1
    • Released October 8, 2018
    • Fix – Added text domain and .pot file to make strings translatable
    • Tweak – Added GitHub Updater link to plugin header
    • Tweak – Added check for PHP 5.6+
    • Tweak – Changed license from GPLv2+ to GPLv3+
  • Version 1.0.0
    • Released October 8, 2018
    • Initial Release