I have a ecommerce webstore using OpenCart with around 2000 products. I have created twitter, goolge+, pinterest and facebook page for this website. With Google moving towards semantic search, all these social signals are increasingly important. Everyday, I have to select one or two products and post on these social media websites. I don't like to do this manually and need to find ways to let a script doing the posting. For facebook page, I can use the APIs for daily auto posting.
When I search for "Facebook PHP SDK for auto posting", there are lots of confusing results, mainly due to code written in different Facebook SDK versions. The documentation from Facebook developers website also quite difficult to understand. However, after reading articles from many websites, trial and error with example codes, finally I am able to do auto posting with Facebook PHP SDK v4 and Graph API v2.2.
Here's my expectations:
1) I want to auto post to Facebook Fan Page as admin.
2) No Login with Facebook required.
3) I want to post product title, product url, and product image, just like normal posting.
4) With 2000++ product listing and still increasing, I want able to auto post three to five items per day. It will take more that one year to post all products from my website.
In part 1 of this article, I will describe how I set up facebook app. In the next article, I will describe the code used to auto post single item to facebook page.
Here's our steps to set up the app:
1) Set up a facebook app at developers.facebook.com. Click Apps ->Add a New App
2) Select Website
3) You are requested to enter name for your new app
4) Click "Create New Facebook App ID" button after done.
) Choose a category for your app. In my case, I select "Shopping". Confirm that you want to "Create App ID".
6) Now you are at new facebook app setup.
7) At the bottom of this page, enter your website domain.
8) Click "Skip Quick Start" at the top and you should have your app ID and secret. Now you have an app to work with.
So we are done here. Before starts writing any code, we need to obtain a permanent Facebook Page Access Token to be used in our script. This will be in next article.
- How to auto publish post on Instagram Page with PHP/cURL and without using Instagram API (1)
- New and Updated! Facebook Remote Status Update with PHP/cURL Bot
- How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (4) - Integrate with Opencart
- How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (3) - Single Product Manual Posting
- How to auto publish post on Facebook Fan Page as admin using Facebook PHP SDK V4 Graph API v2.2 (2) - Get Permanent Page Access Token