Page 1 of 2
Facebook Debugger Does Not See Phoca Open Graph Tags At All
Posted: 10 Apr 2014, 18:34
by xaashley
sfaxa.org/blog/108-drone-wars-q-a
If you view page source you'll see the Phoca og tags generated correctly (except the image tag at the time of posting), however...
When you run this address through Facebook's Debugger and select "See exactly what our scraper sees for your URL " at the very bottom, there are NO Phoca og tags at all.
Any ideas???
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 13 Apr 2014, 18:55
by Jan
Hi, hmm, really no idea what FB does not display the tags when they are here? Did you ask Facebook developers
Jan
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 16 Apr 2014, 00:11
by xaashley
Hi Jan,
No, I have not contacted FB as the issue seems to be with either Joomla or Phoca. The meta tags being generated read "meta name=" when they should read "meta property=" for fb to recognize them.
I was able to solve that problem by changing a core Joomla file. :/
To get FB to recognize the meta tags at all, though, I had to remove all settings from Phoca OG plugin and upload an image named after the article to images/phocaopengraph DESPITE their being both intro and fulltext images assigned in the article settings. :/
Now FB actually recognizes the meta tags but I'm getting a new error...
Scrape Information
Response Code 200
Fetched URL sfaxa.org/blog/131-rooms-for-rent
Canonical URL sfaxa.org/blog/131-rooms-for-rent
Errors That Must Be Fixed
Object at URL 'sfaxa.org/blog/131-rooms-for-rent' of type 'article' is invalid because it specifies multiple 'og:url' values: sfaxa.org/blog/131-rooms-for-rent, sfaxa.org.
I have double checked in my plugins for Joomla and Phoca is the only result when searching for "open" and "meta" - I DO have site metadata assigned within Joomla global config but there is no site url assigned there.
I have no idea what where FB is getting the site url as a meta tag... it doesn't even display in my page's source code! Gah - I'm getting ready to give up
Please help if you can!
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 17 Apr 2014, 16:08
by Jan
Hi, which version of Phoca Open Graph plugin you are running?
Unfortunately it is hard to help there as FB changes the rules regularly and the plugin just renders the code which are demanded by FB - but then everything - all the framework is driven by FB - so if something will work or not depends on the FB framework
The next problem is, Phoca Open Graph plugin does not render the meta tags, they are rendered by Joomla!:
Code: Select all
// Title
if ($this->params->get('title'.$suffix, '') != '') {
$document->setMetadata('og:title', htmlspecialchars($this->params->get('title'.$suffix, '')));
} else if ($row->title != '') {
$document->setMetadata('og:title', htmlspecialchars($thisTitle));
}
method setMetadata is Joomla! method, so if there should be some customization, it should be done in Joomla! directly, but really no idea if this is the problem
Jan
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 17 Apr 2014, 19:37
by xaashley
Hi Jan,
Let me explain again because your last message really just states the same things I said in my pp. Here are the issues I'm experiencing:
1. Joomla writes meta tags with the name attribute instead of property. I have currently fixed that with a hack to the core Joomla files.
2. Phoca OG will ONLY generate image meta tag if I manually add a copy of the article image to images/phocaopengraph. This is in spite of assigning intro and fulltext images to the article via Joomla's options.
3. Facebook is still not scraping Phoca OG's meta tags correctly. While it does recognize them, I'm getting an error saying I've specificed multiple og:url values, which I cannot locate.
I'm using Phoca OG 3.0.0 on a Joomla 3.2.3 site with a rockettheme template.
Hope that info clears up my questions - Thanks for the help!
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 21 Apr 2014, 19:24
by Jan
Hi, I understand the questions, but e.g. by 3) I really don't know the answer - the required fb code is sent by the plugin to Joomla! which renders it (with your modifications, it renders it by the FB guide) but why then FB does not accept, I really cannot say
So if I understand the 3) correctly - with all your modifications, you have made the right output code ... this means, when it is rendered, no Phoca plugin, no Joomla! or not rockettheme template is somehow assigned to the problem as they did their work - they just rendered (with your help the right code) to your html - but why it is not accepted by FB or why it says there is an error - I really cannot say
Jan
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 27 Apr 2014, 12:02
by lukasko
Hi, I have similar problem and I think the reason is in metatag attribute "name". Phoca Open Graph plugin generates metatags as follows:
<meta name="og:image" content="..." />
But it seems that FB doesnt accept such tags, it should be
<meta property="og:image" content="..." />
I found similar discussion here:
viewtopic.php?f=29&t=24697
Do you have any idea how to rewrite the code using Joomla native methods (similar to setMetadata)? Thank you
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 27 Apr 2014, 12:46
by lukasko
It seems that addCustomTag method works. I've tried to add my own method to plgContentPhocaOpenGraph class
public function setMetadata($attrName, $attrValue, $content){
$document = JFactory::getDocument();
$metatag = "<meta $attrName='$attrValue' content='$content' />";
$document->addCustomTag($metatag);
}
and replace all occurencies of "$document->setMetadata(" with "$this->setMetadata('property'," and now it is ok.
And one more suggest - it would be perfect to take og:description from articles, not from site main description.
Thank you for your work
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 03 May 2014, 12:40
by Jan
Hi, thank you for the info, I will take a look at it for the next version.
Jan
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 08 May 2014, 03:02
by miningmedia
xaashley wrote:Hi Jan,
3. Facebook is still not scraping Phoca OG's meta tags correctly. While it does recognize them, I'm getting an error saying I've specificed multiple og:url values, which I cannot locate.
I'm using Phoca OG 3.0.0 on a Joomla 3.2.3 site with a rockettheme template.
I do know why you have a duplicate on Rockettheme... check your index.php file in your template folder. They are attempting to put OG in the header but they're pulling from the root of the site and not the actual article.