Closed notallow closed 6 years ago
Do you have a specific use case which you are trying to add those duplicate tag names? What exactly are you adding to these meta-tags?
I want to implement this rule:
Instant Articles – when adding an Instant Article to your RSS feed, add tags straight to your stories.
from https://www.facebook.com/facebookmedia/get-started/audience-optimization
This is referring to add the tag to the post you are making on Facebook, just like any regular post, by enabling this feature to your page, then using this feature once you are sharing a post.
As far as I know we don't have this configuration granularity to the Instant Article markup document. Do you have any other link to the specs you are following regarding the adding tags to the head of Instant Articles?
The documentation describing interest tags is not very detailed, but Audience Optimization guide mentioned above is referring to Instant Article RSS feed, so this markup should be applied to the Instant Articles.
Also regarding https://developers.facebook.com/docs/instant-articles/reference/article
At the article level, a series of configuration options can be defined in the markup to customize the way the article is presented ... For more detail, refer to our guide to Open Graph markup.
Open Graph markup of the Article contains article:tag property: https://developers.facebook.com/docs/reference/opengraph/object-type/article/
Also I have tested Instant Article manual editor and it accepts multiple meta with property="article:tag" without any warning.
All the Open Graph rules does apply to the Instant Article links, since an Instant Article enabled link sometimes is not rendered as Instant Article (in a desktop browser for example). This way, if the documentation for web links on the audience targeting refers to adding those meta-tags, those were expected to be added into your web article link (the html code on your site only), not inside the Instant Articles markup.
So this will not make sense to implement inside Instant Articles markup/SDK. If this changes in the future, for sure we will want to cover this use case into the SDK.
Thanks for bringing this case.
Steps required to reproduce the problem
I call addMetaProperty repeatedly with the same property_name= "article:tag" but with different tags, e.g. code used in the functions.php of Wordpress theme
Expected Result
All "article:tag" meta properties are set in the IA
Actual Result
Only the last "article:tag" meta property set in the IA
Looks like the problem is metaProperties field declared as array which could not contain multiple elements with the same property_name.
https://github.com/facebook/facebook-instant-articles-sdk-php/blob/5235408c56daaf3aafbfd52e9d9204cc52f14224/src/Facebook/InstantArticles/Elements/InstantArticle.php#L42