Jump to content
  • 0

Facebook Open Graph Meta Tags


bnorris391

Question

Has anyone had issues with deploying the Facebook Open Graph meta tags in the Header of a datapage? I placed the core OG tags in the Header of a datapage and then ran the URL through Facebook's Open Graph Object Debugger. I received the following error:

 

"Your page has meta tags in the body instead of the head. This may be because your HTML was malformed and they fell lower in the parse tree.
Please fix this in order for the tags to be usable.
"

 

Does anyone have any insight into this issue? Facebook is taking the Datapage name and treating it as the OG:Title tag rather than the declared value.

 

Thank you in advance

 

Brad

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello!

As far as I know, Header is not Head.

 

The struture of a HTML document is:
HTML

Head

Body

 

And Body can cosist of
Header

Content

Footer

 

Head contains some information about the page (metadata), and Body contains a content of the page, only contain of Body is dispayed.

 

It is better to place OG tags in Head of the page, where you deploy your datapage.

Link to comment
Share on other sites

  • 0
Hello Brad,

You can use the JavaScript code like:



<script language="JavaScript">
var meta = document.createElement('meta');
meta.name = "Author";
meta.content = "Name";
document.getElementsByTagName('head')[0].appendChild(meta);
</script>


To add the JavaScript code to your DataPage, add it to the Footer of the DataPage.

 

Best regards,

Jan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...