Jump to content
  • 0
bnorris391

Facebook Open Graph Meta Tags

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
  • 0
Good afternoon Jan -
 
Thank you very much for your response. In this situation, I am deploying the datapage as a URL not as a piece of code in another page so I am trying to access the Head of the document from within the Caspio interface. Any suggestions?
 

Best regards,
Brad

Share this post


Link to post
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

Share this post


Link to post
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...