- APPS
- Facebook Social Marketing 17.0
| Lines of Code | 2874 |
| Technical name | viin_social_facebook |
| License | OPL-1 |
| Website | https://viindoo.com/apps/modules/17.0/viin_social_facebook |
| Read description for | v 13.0 v 14.0 v 15.0 v 16.0 v 18.0 v 19.0 |
| Required Apps | Discuss (mail) |
| Included Dependencies | Viindoo Base Social Marketing API Request Logger |
Write, approve and publish your Facebook posts, then answer the Page, without leaving Odoo
For marketing teams that run one or more Facebook Pages
Integrate the Social Marketing app with Facebook
Odoo Community · OPL-1 license · English, Vietnamese
Adds Facebook to Social Marketing.
Every call to Facebook is recorded by API Request Logger.
What changes for your team
One article, approved, then on the Page
Today the text is written in one place and retyped in Facebook, with nobody checking the files or the time.
→ The editor writes the article with its Facebook preview; the form states which files and which schedule Facebook accepts; an approver publishes it now or at the chosen time.
Messenger answered from Discuss
Today the team watches Messenger in another window and answers outside Odoo.
→ Each person who writes to the Page has a conversation in Discuss; the team answers there, and comments and reactions arrive as notices.
A failed post says why
Today a video that does not appear on the Page leaves nobody knowing which side refused it.
→ Videos upload in the background; a failed post shows its reason, and an approver fixes the cause and presses Retry.
What you see as an administrator
Which notification from Facebook failed, and why?
Each comment, reaction or message Facebook sends is queued with its state, attempts and failure reason.
Features
Publishing
- ✓ Text, link, photo or one-video posts to one or several Pages
- ✓ Scheduling on Facebook, from 30 minutes to 29 days ahead (70 days for a video that is not a Reel)
- ✓ Facebook preview while writing the article
- ✓ Background video upload, with Retry after a failure
- ✓ Delete a published post from the Page
Page activity
- ✓ Recent posts synchronized, scheduled ones included; older posts on demand
- ✓ Read, add, like, hide and delete comments of a post
- ✓ Comments and reactions arrive as notices
- ✓ Posts removed on Facebook are archived, never deleted
- ✓ Page reviews, refreshed on request
Conversations and connection
- ✓ Messenger conversations in Discuss, one per person
- ✓ Webhooks registered per Page, showing only what Facebook confirms
- ✓ Failed notifications listed with their reason and a Retry button
- ✓ Calls to Facebook logged per account, Page and post
Built for daily use
- ✓ Roles: Editor writes, Approver publishes, Administrator connects
- ✓ Facebook app credentials per company
- ✓ App Secret and Verify Token visible to system administrators only
- ✓ Tokens and secrets masked in the logs
Ready on day one
The Facebook account record
Shows the Redirect URL and Webhook URL to copy into your Facebook app, and whether the account is connected.
Background jobs
Video upload and the daily archive of posts removed from Facebook run without anyone starting them.
What the administrator sets first
The App ID and App Secret of your Facebook app. Each company has its own Verify Token, which starts with a random value you may replace. Then link the account and register the webhooks of each Page.
Before you decide
What do we need on the Facebook side?
Your own Facebook app, allowed to use the Page permissions listed in the Documentation tab (Messenger needs one more). Facebook grants these permissions, not the module. Facebook sends comments and messages only to an app in Live mode, and accepts only an HTTPS address for your database.
Where does our data go?
From your Odoo server to Facebook, through your own app. No other service sits in between.
Who can publish?
Editors write and confirm articles; approvers publish, synchronize and retry; administrators connect the account and the Pages. Messenger conversations reach the members of the Page.
What happens when Facebook refuses something?
The post or notification shows Facebook's reason, and the call is in the logs. One limit is Facebook's own: a reply from the Page is accepted within 24 hours of the person's last message. After that, the reply is retried once with Facebook's Human Agent tag, which accepts it up to 7 days, when your Facebook app has Advanced Access; otherwise it is refused with an explanation.
Can several companies use it in one database?
Yes. Each company has its own Facebook app credentials and Verify Token; one Webhook URL serves them all.
Try it, then ask us
The Documentation tab walks each role through setup and daily use; the Live Preview button of this listing opens a working database.
Pre-sales & partnership
viindoo.com/contactusTechnical support
viindoo.com/ticketFacebook Social Marketing - user guide
Who this guide is for: the people who prepare and publish posts on a Facebook Page from Odoo (editors and approvers), the Social Marketing administrator who connects the Page, and the system administrator who enters the credentials of the Facebook app. It describes what each of them sees and does; it does not require any knowledge of the software's internals.
Note
Extends Social Marketing: the articles, posts, notices, webhook notification queue and the general rules of publishing are described in the Social Marketing documentation. The call history behind the API Logs button is provided by API Request Logger. This guide covers what is specific to Facebook.
Overview
Facebook Social Marketing publishes the articles of Social Marketing on Facebook Pages (text, link, photos or one video), keeps the posts of the Page in Odoo, brings the comments, reactions and Messenger messages of the Page to Odoo, and lets the team answer them.
| Role | What they do | Access right to assign |
|---|---|---|
| System administrator | Enters the App ID, App Secret and Verify Token of the Facebook app; reads the history of calls to Facebook | Settings: Administration / Settings |
| Social Marketing administrator | Links the Facebook account, registers the webhooks of each Page, reads the notifications received from Facebook | Social Marketing: Administrator |
| Editor | Writes articles for Facebook, reads and answers Messenger conversations | Social Marketing: Editor |
| Approver | Publishes articles, retries failed video posts, synchronizes the posts of a Page | Social Marketing: Approver |
The process: the administrators connect the Page once; an editor writes and confirms an article; an approver publishes it; Facebook answers (Posted or Failed); comments and messages sent to the Page come back to Odoo.
Setup (for the administrators)
Install the module
- Open Apps, search for Facebook Social Marketing and press Install. It requires Social Marketing.
- In Social Marketing ‣ Configuration ‣ Settings, open the Social Media tab. The Facebook block shows Enable Social Facebook; tick it to publish on Facebook.
Facebook app permissions
Odoo talks to Facebook through version 27.0 of the Facebook Graph API. The Facebook app must be allowed to use these permissions: public_profile (identify the account that links the Pages), pages_show_list (list the Pages), pages_read_engagement and pages_read_user_content (read posts, comments and reactions), pages_manage_posts (publish posts), publish_video (publish videos), pages_manage_engagement (answer and moderate comments), pages_manage_metadata (register the webhooks) and, to work with Messenger, pages_messaging. Facebook delivers the notifications of a Page (comments, reactions, messages) only to an app that is in Live mode; an app still in Development mode receives only the test notifications sent from its dashboard. Facebook signs each notification with the App Secret (SHA-256 signature); Odoo accepts a notification only when its signature is valid for the App Secret of the company, so the App Secret typed in Odoo must be the one of the Facebook app that sends the notifications.
Without Advanced Access, the Facebook app serves only the Pages managed by people who have a role on the app. The Pages of other businesses, and the reply to a Messenger conversation after 24 hours (see Messenger conversations), need Advanced Access: Meta App Review and business verification of the company that owns the app. The Setup guide button next to this sentence on the Facebook record opens the steps.
Enter the credentials of the Facebook app (system administrator)
- Open Social Marketing ‣ Configuration ‣ Settings and the Social Media tab.
- In the block Facebook App, fill App ID and App Secret. Both are found in the App settings > Basic page of your app in Meta for Developers; the documentation icon next to the block title opens that site and the Setup guide button opens step-by-step instructions.
- Each company has its own Verify Token field; a new company starts with a random value. You can replace it with any value you like, as long as the same value is typed in the Facebook app when you declare the Webhook URL (next section).
- Press Save.
The App Secret and the Verify Token are visible only to system administrators.
Declare the addresses and link the account (Social Marketing administrator)
- Open Social Marketing ‣ Configuration ‣ Social Media and select Facebook.
- Press the copy button of Redirect URL and paste it into the Facebook app, as a valid OAuth redirect address, before the next step.
- Press the copy button of Webhook URL and paste it into the webhook settings of the Facebook app. Facebook asks for a verify token: type the Verify Token of the settings of this company. One Webhook URL serves all companies of the database.
- Press LINK ACCOUNT and accept the permissions on the Facebook page that opens, then Synchronize Pages to read the Pages the account manages.
The record shows a yellow badge Not connected: press LINK ACCOUNT, or a green badge Connected once the account is linked; the Setup guide button next to the badge opens the instructions. Facebook accepts only HTTPS addresses: when the public address of the database is not HTTPS a warning is shown at the top of the record (see the Social Marketing documentation).
Once the account is linked and the Pages are synchronized, the record also shows (to the Social Marketing administrator):
- Token Expired Date: the date on which the token of the connection expires, as Facebook reports it. Past that date press LINK ACCOUNT again. The Page permissions of the connection do not expire with the 90-day data access of the Facebook account, and the connection shows no end date when Facebook reports the token as non-expiring. Facebook may remove a permission the app has not used for 90 days.
- Facebook Granted Permissions: the permissions Facebook reports for the linked account, read at LINK ACCOUNT and at each synchronization of the Pages. Compare it with the list in Facebook app permissions: a missing permission explains a refused publication or reading.
- App Webhook: Subscribed when the Facebook app is subscribed to the Page notifications with the Webhook URL of this record (the fields it receives are listed in App Webhook Fields), Another Address when the app sends them to a different address, Not Subscribed otherwise. In the last two cases a warning says that Facebook does not send the comments and messages of the Pages to this database: in the Webhooks settings of the Facebook app, subscribe the Page object to the fields feed and messages with the Webhook URL of the record. The state is empty until the first synchronization of the Pages.
Calls limited by Facebook
When Facebook refuses a call because the app made too many, Odoo shows an ordinary warning, for example Facebook is limiting the calls of this app for now. Try again in about 17 minutes. (or Try again later when Facebook gives no wait; the scheduled jobs then wait one hour). The record shows, in a warning visible to the Social Marketing administrator, The social network limited the calls of this app. Scheduled synchronizations resume after followed by the time and the reason Facebook gave. Until that time:
- the scheduled jobs (synchronizations, the queue of webhook notifications, the check of removed posts) leave the connection alone, and the notifications wait without a failed attempt;
- a video or Reel that is being uploaded stays in Uploading; the time it waits is not counted against it, and the upload goes on by itself afterwards;
- an action you start yourself, such as Synchronize Posts, is still sent to Facebook.
The warning disappears when the time is over.
Register the webhooks of a Page
Open Social Marketing ‣ Pages, select the Page and open the tab Facebook Settings. The field Subscribed Apps lists only what Facebook itself confirms:
- Empty: Facebook sends nothing about this Page to Odoo - no comment, reaction or message arrives. Press Register Webhooks. If Facebook refuses, Odoo shows the reason given by Facebook; correct it (for example the permission or the mode of the app) and press the button again.
- Filled (for example feed, messages, message_mention): Facebook sends the notifications of the Page to Odoo. Cancel Webhooks stops them.
Linking the account or pressing Synchronize Pages also registers a new Page. A Page whose webhooks you cancelled stays cancelled.
Editor: write articles for Facebook
The general steps to write, confirm and publish an article are in the Social Marketing documentation. When a chosen page is a Facebook Page, the article form adds the following.
- Under the attachments, the line Facebook: one mp4 video up to 2 GB on its own, or png / jpeg images up to 4 MB each. A video must be the only file of the article. Another format, a second file next to a video or a file over the limit is refused when you confirm, with a message that says which file and why. The Setup guide button below opens the detailed rules.
- Schedule later and Scheduled Post Date publish at a given time. Under the date, the line Facebook accepts a time between 30 minutes and 29 days from now. (a text, photo or Reel post) or Facebook accepts a time between 30 minutes and 70 days from now. (a video that is not a Reel) gives the accepted range. Turning on Schedule later or typing the date never shows an error box.
- Publish as Reel appears when the article has one video and at least one Facebook Page is chosen. Tick it to publish the video as a Facebook Reel instead of a regular video (Meta asks for a vertical mp4 video of 3 to 90 seconds; the Setup guide button below the box opens the details). With Schedule later, a Reel accepts a time between 30 minutes and 29 days from now, and the line under the date reads Facebook accepts a time between 30 minutes and 29 days from now. A time outside that range is refused when you confirm the article; untick Publish as Reel to use the 70-day range of a regular video. A scheduled Reel is published by Facebook at its time; the post turns Posted within the next run of the five-minute scheduled action. Other networks chosen for the same article publish the video as usual.
- The Facebook preview on the right shows how the post looks on the Page: your text, the first image, and the time (the current time until a date is typed, then the scheduled date). The picture is shown also while the article is not yet saved.
Approver: publish and follow the posts
Publish
Open a confirmed article and press Post on Social Media. Each Facebook Page chosen gets one post. A text, link or photo post is sent at once (or scheduled on Facebook when Schedule later is on). A video, or a Reel, is sent in the background, in several steps, so that you can keep working. A Reel goes through the same states as a video and is marked Reel on the post.
States of a Facebook post
| State | Meaning |
|---|---|
| Ready | Waiting to be published. |
| Scheduled | Facebook will publish the post at the chosen time. |
| Uploading | The video or Reel is being sent to Facebook in the background. A scheduled action sends it every five minutes. While Facebook limits the calls of the app, the post waits in this state and goes on by itself afterwards. |
| Publishing | The video or Reel is sent and Facebook is processing it. The state changes by itself once Facebook answers. When Facebook does not act on the end of a Reel upload, Odoo sends it again a limited number of times. |
| Posted | The post is on the Page. View on Social opens it. |
| Failed | Facebook or Odoo could not publish. The Failure Reason is shown at the top of the post. |
| Cancelled | The post was dropped. |
A post that is being published cannot be cancelled, edited or deleted; wait for Posted or Failed. A post already on the Page cannot be cancelled: use Delete Post, which also removes it from Facebook.
When a video post fails
- Open the post and read the Failure Reason. Typical reasons are shown in Facebook's words or in plain sentences, for example: the connection to the Page has expired or lacks the permission to publish (link the account again); the video is too large or too long; the video format is not accepted (select an mp4 video); the upload timed out; the video was blocked by the content policy of Facebook; the scheduled time came too close while the video was uploading (cancel the post and publish again with a later time). For a Reel that Facebook cannot process the reason reads Facebook could not process the video of this Reel. Check that the file is a valid mp4 video, then retry.
- When the reason says that Facebook did not confirm the end of the upload and names a video, the video may already be on the Page: check the Page before retrying.
- Fix the cause and press Retry (approvers only), or press Cancel to give up. The upload starts again.
The people concerned (author, assignee and the person who asked to publish) are notified. The API Logs button of the post shows what Facebook answered (see the system administrator's chapter).
When the sending of the file of a Reel is interrupted, the next run of the job reads from the upload address the offset Facebook holds and sends the rest of the file from that offset: the Reel is not started again. When Odoo cannot read the offset, it sends the whole file again from the first byte. A partial receipt, or an offset Facebook does not hold, is not a failure: the next run reads the offset again and goes on.
A Reel that is being uploaded shows the Uploading state and the ticked Reel box:
Likes, comments and shares of a video or Reel
Open a published video or Reel from Social Marketing ‣ Posts: the post window shows its likes, comments and shares, and refreshes them from Facebook. A video or Reel that Facebook has not yet linked to a regular post still shows the figures Facebook gives for the video itself, without an error. When a video or Reel is removed on Facebook, Facebook's removal notice archives the post in Odoo (see Posts removed on Facebook).
Synchronize the posts of a Page
On the Page (Social Marketing ‣ Pages):
- Synchronize Posts reads the 100 most recent posts of the Page, including the posts scheduled on Facebook. A video published from Odoo stays one single post linked to its article; the same video is never duplicated or archived by a synchronization. If Facebook refuses the reading of one Page, a readable message is shown.
- Synchronize Old Posts appears only when older posts remain; each press reads up to 500 older posts. The option Sync all posts of the Page lets a daily scheduled action read them progressively.
Posts removed on Facebook
A post that you delete on Facebook, or move to its trash, is archived in Odoo - never deleted - and its state does not change. A daily scheduled action, Social: Archive Posts Removed from Facebook, checks every Page after reading its whole list of posts and scheduled posts; a Page that cannot be read is skipped and the other Pages are still checked. An archived post that Facebook lists again becomes active again.
Reviews of the Page
The tab Reviews of the Page lists the reviews people left on the Page. Refresh replaces the list with the reviews Facebook sends (a Page without reviews ends with an empty list) and View on Page opens the reviews on Facebook. When Facebook refuses to give the reviews (for example, a permission is missing), the reviews already stored are kept and the error returned by Facebook is shown. Only editors and above can refresh the reviews.
Messenger conversations
Editors (and above) who are members of the Page receive its Messenger conversations. To answer one, the user needs the Editor access right of Social Marketing and must be a member of the channel of the Page.
- On the Page, press Get Message: Odoo reads the 25 most recent conversations (only the user assigned to the Page or a manager can do it). New messages also arrive by themselves once the webhooks are registered.
- Open Discuss. The conversations are in the category Social Conversation, one per person.
- Type your answer in the conversation and press Send.
A conversation appears without a picture when Facebook refuses to give the picture or the name details of the person; it can still be read and answered.
Facebook accepts a reply from the Page within 24 hours of the person's last message to the Page. After that, Odoo sends the reply once more with Facebook's Human Agent tag, which Facebook accepts for up to 7 days after the person's last message, provided the Facebook app has Advanced Access to the Human Agent feature (Meta App Review and business verification). When Facebook refuses it too, Odoo shows Facebook's own words, followed by Facebook accepts a reply from the Page within 24 hours of the person's last message. A reply written by a person is accepted within 7 days when the Facebook app has Advanced Access to the Human Agent feature (Meta App Review and business verification). The reply was not sent and is not saved in this conversation. The reply is not kept in the conversation. Any other refusal (for example an expired connection) shows Facebook's words and the same last sentence, without a second attempt. A refusal that is not a limit of the calls of the app (for example a warning about bothersome behaviour) does not pause the connection. Files cannot be sent in a reply. Names and messages written by people on Facebook are shown as plain text.
Troubleshooting
- Subscribed Apps is empty / nothing arrives from Facebook: press Register Webhooks and read the reason Facebook gives if it refuses. Check that the app is in Live mode and that the Webhook URL and the Verify Token were declared in the Facebook app.
- LINK ACCOUNT says the connection could not be verified: the message is a page of the web interface (company logo, the sentence in a red alert and a Back to Social Media button that returns to the record of the connection): press LINK ACCOUNT again. When the message says it failed, the system administrator reads the reason in API Logs.
- A video post is Failed: read the Failure Reason, fix, press Retry.
- A reply to a Messenger conversation is refused: the person's last message is older than 24 hours and the Facebook app has no Advanced Access to the Human Agent feature (accepted up to 7 days), or Facebook gives another reason, which the message quotes.
- The record says the social network limited the calls of this app: wait for the time shown; the scheduled jobs resume by themselves and videos or Reels waiting in Uploading go on.
- A Reel is Failed: read the Failure Reason (for example the file is not a valid mp4 video, or the scheduled time is outside 30 minutes to 29 days), fix, press Retry.
- The reviews of the Page do not refresh: the error shown is Facebook's own (often a missing permission); the reviews already stored stay in the list.
- No comment or message arrives although the Page is registered: on the Facebook record, App Webhook is Not Subscribed or Another Address; subscribe the Page object of the Facebook app to feed and messages with the Webhook URL of the record.
- A post disappeared from the list: it was deleted or trashed on Facebook and is archived.
FAQ
Which Facebook files can I publish? One mp4 video of up to 2 GB on its own, or png / jpeg images of up to 4 MB each.
How far ahead can I schedule? From 30 minutes up to 29 days from now for a text, photo or Reel post; up to 70 days from now for a video that is not a Reel.
Can I publish a video as a Reel? Yes: tick Publish as Reel on an article that has one video and a Facebook Page. Who can retry a failed post? Approvers and administrators.
Is a post deleted on Facebook deleted in Odoo? No, it is archived.
This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file).
You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software.
The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Social Marketing administrator and system administrator: notifications and call history
Webhook notifications
On the Facebook record, the Webhook Notifications button lists the notifications Facebook sent to Odoo. States: Pending (waiting; processed again automatically), Done (processed) and Failed (after five unsuccessful attempts, with the Failure Reason). Select a failed notification and press Retry once the cause is fixed (Social Marketing administrators only); it is processed again in the background. Comments and messages reach Odoo after a short delay for that reason. While Facebook limits the calls of the app, notifications stay Pending without counting a failed attempt and are processed once the wait is over.
API Logs
When a connection, a publication or a synchronization fails, the system administrator opens the API Logs button of the Facebook record, of the Page or of the post. It lists the calls made to Facebook with the HTTP method, the response status, the error message and the duration; a failed call is logged even though the user's action was cancelled. Tokens, codes and secrets are masked in the address, the request and the answer.