Setting Up Facebook Instant Articles RSS Feed with Outbound Feeds
Feed Configuration
The Facebook Instant Articles RSS feed is a platform level Arc XP feed block with configurable and customizable parameters.
Steps to configure the Facebook Instant Articles RSS feed.
Channel Configuration
1. RSS Title
Value for RSS title.
default: feedTitle environment value
2. RSS Description
Value for RSS description.
default: feedTitle + " News Feed"
3. RSS Language
Value for RSS language using an ISO-639 value. If left blank it will default to the value of feedLanguage set in your blocks.json. The tag can be removed by entering “Exclude” in the field.
default: blank (uses feedLanguage)
4. Copyright
Optional value for copyright.
default: no copyright
5. Time to Live
Suggested number of minutes that the consumer could cache the results.
default: 1
6. Update Period
Used in combination with Update Frequency, this is the unit of time. If Excluded both Update Period and Update Frequency will be excluded from the feed.
Select one: hourly, daily, weekly, monthly, yearly or Exclude field
default: hourly
7. Update Frequency
Used in combination with Update Period, this is the interval expressed as an integer. Combining the two default values results in 1 hour. A suggestion for how often the page is requested.
default: 1
8. Category
Optional string value for a category to describe the RSS feed.
default: no category
9. Logo URL
Optional fully qualified URL of an image to use as the logo for the RSS feed.
default: no logo
Item Configuration
1. Title
ANS field(s) to use for the article headline, supports a JMESPath statement.
default: headlines.basic
2. Description
ANS field(s) to use for the article description, supports a JMESPath statement.
default: description.basic
3. Publication Date
ANS date field to display.
Select one: created_date, display_date, first_publish_date, last_updated_date
, or publish_date
default: display_date
4. ANS credits key
ANS field to use for the article credits <dc:creator>
supports a JMESPath statement. Multiple authors will be joined with a comma.
default: credits.by[].name
5. Category
Optional ANS field(s) to use for the article category, supports a JMESPath statement.
default: no category
6. Number of paragraphs to include
Number of paragraphs of the article body to include. Value ranges from 0 to 10, or all.
default: all
Featured Image Configuration
1. Include promo Images
Yes/No should the promo_items be added with a <media:content>
tag.
default: true
2. Path to promo_items
ANS field to use for the featured image, supports a JMESPath statement.
default: promo_items.basic || promo_items.lead_art
3. Image height and or width
A set of key value pairs where you can set an integer height and or width to resize all images. Zero means no resizing will be performed.
default: height: 0, width: 0
4. ANS image title key
ANS field for the promo_items title.
default: title
5. ANS image caption key
ANS field for the promo_items caption.
default: caption
6. ANS image credits key
ANS field for the promo_items credits.
default: credits.by[].name
Video
Video encoding
A set of key value pairs to select the video encoding you want to use in the feed. It filters the video streams array using the provided keys and values to choose an encoding.
default: bitrate: 2000, stream_type: mp4
Facebook Instant Configuration
1. Article Style
Optional, If you have configured a style in the Facebook Admin, you can specify it here. Otherwise it will use the default style.
default: default
2. Likes and Comments
Enable or disable likes and comments.
default: disable
3. Additional Meta Tags
Optional, allows for multiple meta tags to be entered. Each tag must be in the format of <meta property=“{property goes here}” content=“{content goes here}” />
4. Auto Ad Placement
Optional, enables automatic placement of ads within this article. You must create an ad in the Ad Scripts customField to enable auto ad placement.
default:false
5. Ad Density
Frequency of when ads will appear in your article; default (<250 word gap), medium (350 word gap), low (>450 word gap)
Select one: default, low, medium
default: default
6. Ad Scripts
Enter Javascript that goes between <section class=“op-ad-template”></section>
in the beginning of the body’s header for recirculation ads that come from Facebook advertisers; leave blank if not used.
7. Analytic Scripts
Javascript wrapped in the <figure class=’op-tracker’>
tag can be added to the article for ads and analytics. Multiple scripts can be included, usually each in its own figure. For example <figure class=“op-tracker”><iframe><script>...</script></iframe></figure><figure class=“op-tracker”><iframe><script>...</script></iframe></figure>
. This must be valid xml which is stricter than what browsers typically allow. For example you can not have empty attributes, and be sure to close all tags.
Some 3rd party scripts want data from the the content being displayed, like the url, author, sections, etc. If you need to include content specific data into a script you can add placeholders with the field name into your script like <<taxonomy.primary_section._id>>
. If you need more customization than just adding ANS fields, you will need to create a custom version of the feed. Your custom analytic script logic could be added Here as a string of html.
8. oembed iframe height and width
Enter an optional height and or width value to be added to <iframe>
tags. This is a key value pair field, you must enter “height” or “width” in the first box, then enter an integer value in the second. A value of zero will be ignored. Default is zero height and width.
9. raw_html_processing
Optional, how should raw_html element be handled. You have the option to “exclude” raw_html elements, “include” raw_html elements exactly as they are in the ANS, or “wrap” raw_html elements in <figure class=op-interactive><iframe>
tags. If oembed height or width are set, they will be added to the iframe.
default: “exclude” raw_html.
Resolver Configuration
Each feed template needs to have a resolver applied. To Create A Resolver, you’ll want to configure these fields.
1. Resolver Name
Unique name given to the resolver
2. Resolver Priority
Number to indicate priority order regex will be evaluated in (1 to 100). Lower numbers are evaluated first.
3. Regex Pattern
^/arc/outboundfeeds/fb-ia/?$|^/arc/outboundfeeds/fb-ia/category/(.*)/?$|^/arc/outboundfeeds/fb-ia/author/(.*)/?$|^/arc/outboundfeeds/fb-ia/keyword/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags_slug/(.*)/?$
4. URL Parameter
5. Websites
all
6. Content Source
feeds-content-api
There are also two optional content sources available out-of-the-box, details Here.
7. Patterns
These positions come from the regex pattern. There are a number of ways to pass a section (or author, keyword or tag) to the content source from the resolver. All of them use a grouping () in the regex.
Section - Pattern 1
^/arc/outboundfeeds/fb-ia/?$|^/arc/outboundfeeds/fb-ia/category/(.*)/?$|^/arc/outboundfeeds/fb-ia/author/(.*)/?$|^/arc/outboundfeeds/fb-ia/keyword/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags_slug/(.*)/?$
Author - Pattern 2
^/arc/outboundfeeds/fb-ia/?$|^/arc/outboundfeeds/fb-ia/category/(.*)/?$|^/arc/outboundfeeds/fb-ia/author/(.*)/?$|^/arc/outboundfeeds/fb-ia/keyword/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags_slug/(.*)/?$
Keywords - Pattern 3
^/arc/outboundfeeds/fb-ia/?$|^/arc/outboundfeeds/fb-ia/category/(.*)/?$|^/arc/outboundfeeds/fb-ia/author/(.*)/?$|^/arc/outboundfeeds/fb-ia/keyword/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags_slug/(.*)/?$
Tags - Text - Pattern 4
^/arc/outboundfeeds/fb-ia/?$|^/arc/outboundfeeds/fb-ia/category/(.*)/?$|^/arc/outboundfeeds/fb-ia/author/(.*)/?$|^/arc/outboundfeeds/fb-ia/keyword/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags_slug/(.*)/?$
Tags - Slug - Pattern 5
^/arc/outboundfeeds/fb-ia/?$|^/arc/outboundfeeds/fb-ia/category/(.*)/?$|^/arc/outboundfeeds/fb-ia/author/(.*)/?$|^/arc/outboundfeeds/fb-ia/keyword/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags/(.*)/?$|^/arc/outboundfeeds/fb-ia/tags_slug/(.*)/?$
Include - Terms
If you don’t want to use the default query you can enter a query here. It must be an array formatted like [{“term”:{“type”: “story”}},{“range”:{“display_date:{“gte”:“now-2d”,“lte”:“now”}}}]
. More details on custom queries can be found Here.
Exclude - Terms
If you need to exclude terms in your query, i.e. using a logical NOT, enter them here as an array formatted the same as the Include-Terms. For example to exclude all content with language “es” you would use [{“term”:{“language”: “es”}}]
. More details on custom queries can be found Here.
Exclude - Sections
You can enter a comma separated list of sections to exclude. For example /premium,/paid-content
.
Feed - Size
Integer 1 to 100. Defaults to 100. If you added a size URL parameter, select the parameter option and select size and enter a default value.
Feed - Offset
Integer. Defaults to 0
. If you added a from URL parameter, select the parameter option and select from and enter a default value.
Sort - publish_date:desc
If left blank it will default to “publish_date:desc”. Which ever date field you selected to display for the PublicationDate is the date you should enter here. If you used a different date, you should use it in the Include-Terms range statement. The format is date_field
+ :
+ sort order
(desc
or asc
). Valid date fields are created_date
, display_date
, first_publish_date
, last_updated_date
, or publish_date
.
Source-Exclude - A comma separated list of ANS fields to remove from the default list of ANS fields. See the default list Here
Source - Include - A comma separated list of ANS fields to add to the default list of ANS fields. See the default list Here
Include - Distributor - Name
If you only want content from a single distributor, enter the name here. You may only populate one distributor field.
Exclude - Distributor - Name
If you want to exclude content from a single distributor, enter the name here. You may only populate one distributor field.
Include - Distributor - Category
If you only want content from a single distributor category, enter the name here. You may only populate one distributor field.
Exclude - Distributor - Category
If you want to exclude content from a single distributor category, enter the name here. You may only populate one distributor field.
8. Default Template
Select the facebook-instant-feed
template to apply resolver.
9. Default output type
Select xml
.
10. Content Mapped Template
blank
Facebook Instant Articles URL
To preview your Facebook Instant Articles RSS XML, modify the URL below with the your client org and website name.
https://outboundfeeds.CLIENTORG.arcpublishing.com/pf/arc/outboundfeeds/fb-ia/?_website=CLIENTWEBSITE NAME
Additional Information
- Steps to create and manage Outbound Feeds.
- Optional Content Sources For OBF.
- Using Jmespath To Map To CustomFields ANS Values.
- More details on Resolvers.
- Regex Debugger.