Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook Sharing Debugger not picking up meta tags #13956

Closed
btahir opened this issue May 10, 2019 · 20 comments
Closed

Facebook Sharing Debugger not picking up meta tags #13956

btahir opened this issue May 10, 2019 · 20 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@btahir
Copy link
Contributor

btahir commented May 10, 2019

Hello -

Facebook is not picking up my meta tags for some reason?

I can clearly see my meta tags on my site: https://9gans.com

But Facebook is not scraping them: https://developers.facebook.com/tools/debug/sharing/?q=9gans.com

I tried a few things including refreshing with ?fbrefresh=blahblah so its not a caching issue like previous questions.

Is there any thing I need to do on my end for Facebook to recognize all the og tags?

Thanks!

@coreyward
Copy link
Contributor

I don't know what you're doing, but it looks like you've deployed the development version of your website. The actual source of your website doesn't include content or your SEO-related meta tags. Indeed, you can confirm this is what Facebook is seeing for your website using the debugger (direct link) by clicking on “See exactly what our scraper sees for your URL” near the bottom of the page you linked.

@btahir
Copy link
Contributor Author

btahir commented May 11, 2019

Development? I just deployed it on Zeit (with the command now) following the Gatsby instructions?

@coreyward coreyward reopened this May 13, 2019
@coreyward
Copy link
Contributor

@btahir Ah, didn't see that you're using the offline plugin. View-source doesn't work with it.

@btahir
Copy link
Contributor Author

btahir commented May 13, 2019

Took out the gatsby-plugin-offline. No difference. :(

@btahir
Copy link
Contributor Author

btahir commented May 13, 2019

@LekoArts
Copy link
Contributor

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

The starter blog doesn't have some of the tags so they don't show up in the debugger. The tags work on all of my projects (and they use the offline plugin) so there is probably a problem with your site.

@freiksenet freiksenet added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label May 16, 2019
@bakeruk
Copy link
Contributor

bakeruk commented May 23, 2019

@btahir are you deploying the output of gatsby build?

Facebook sees the same content which is in your public/index.html when you build. Could you show us your version of that file please?

@DSchau
Copy link
Contributor

DSchau commented May 23, 2019

Your meta tags are as follows:

<meta name="generator" content="Gatsby 2.3.31"/>
<link rel="preconnect dns-prefetch" href="https://www.google-analytics.com"/>
<meta name="theme-color" content="#ffffff"/>
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/fav180.png"/>
<title data-react-helmet="true">9 GANS | 9 GANS</title><link data-react-helmet="true" rel="fav" sizes="180x180" href="/favicons/fav180.png"/>
<link data-react-helmet="true" rel="icon" type="image/png" sizes="32x32" href="/favicons/fav32.png"/>
<link data-react-helmet="true" rel="icon" type="image/png" sizes="16x16" href="/favicons/fav16.png"/>
<meta data-react-helmet="true" name="description" content="An AI Generated Art Gallery"/>
<meta data-react-helmet="true" property="og:title" content="9 GANS"/>
<meta data-react-helmet="true" property="og:image" content="https://9gans.com/images/header.jpg"/>
<meta data-react-helmet="true" property="og:description" content="An AI Generated Art Gallery"/>
<meta data-react-helmet="true" property="og:type" content="website"/>
<meta data-react-helmet="true" name="twitter:card" content="summary_large_image"/>
<meta data-react-helmet="true" name="twitter:image" content="https://9gans.com/images/header.jpg"/>
<meta data-react-helmet="true" name="twitter:creator" content="9gans"/>
<meta data-react-helmet="true" name="twitter:title" content="9 GANS"/>
<meta data-react-helmet="true" name="twitter:description" content="An AI Generated Art Gallery"/>
<meta data-react-helmet="true" name="msapplication-TileColor" content="#da532c"/>
<meta data-react-helmet="true" name="theme-color" content="#ffffff"/

Weirdly it does seem like your tags aren't being parsed (e.g. og:title and og:description are not being picked up). Could you share a reproduction and/or more info as to how you're creating the meta tags? Perhaps Facebook's parser is choking on other content prior to the meta tags? Not sure--hard to tell!

Thanks!

@btahir
Copy link
Contributor Author

btahir commented May 24, 2019

I will work to get a simple reproduction.

I am using this as my starter so it's very similar: https://github.com/parmsang/gatsby-starter-ecommerce

Here is the my SEO file in the mean while:

/* eslint-disable react/require-default-props */
/* eslint-disable react/forbid-prop-types */
import React from 'react'
import PropTypes from 'prop-types'
import {Helmet} from 'react-helmet'
import {useStaticQuery, graphql, withPrefix} from 'gatsby'

function SEO({description, lang, meta, keywords, socialImage, title}) {
  const {site} = useStaticQuery(
    graphql`
      query {
        site {
          siteMetadata {
            title
            description
            siteUrl
            author
            image
          }
        }
      }
    `,
  )

  const image = socialImage || `${site.siteMetadata.siteUrl}${site.siteMetadata.image}`
  const metaDescription = description || site.siteMetadata.description
  
  return (
    <Helmet
      htmlAttributes={{
        lang,
      }}
      title={title}
      titleTemplate={`%s | ${site.siteMetadata.title}`}
      meta={[
        {
          name: `description`,
          content: metaDescription,
        },
        {
          property: `og:title`,
          content: site.siteMetadata.title,
        },
        {
          property: `og:image`,
          content: image,
        },        
        {
          property: `og:description`,
          content: metaDescription,
        },
        {
          property: `og:type`,
          content: `website`,
        },
        {
          name: `twitter:card`,
          content: `summary_large_image`,
        },
        {
          name: `twitter:image`,
          content: image,
        },        
        {
          name: `twitter:creator`,
          content: '9gans',
        },
        {
          name: `twitter:title`,
          content: site.siteMetadata.title,
        },
        {
          name: `twitter:description`,
          content: metaDescription,
        },
        {name: 'msapplication-TileColor', content: '#da532c'},
        {name: 'theme-color', content: '#ffffff'},
      ]
        .concat(
          keywords.length > 0
            ? {
                name: `keywords`,
                content: keywords.join(`, `),
              }
            : [],
        )
        .concat(meta)}
    >
      <link
        rel="fav"
        sizes="180x180"
        href={withPrefix('/favicons/fav180.png')}
      />
      <link
        rel="icon"
        type="image/png"
        sizes="32x32"
        href={withPrefix('/favicons/fav32.png')}
      />
      <link
        rel="icon"
        type="image/png"
        sizes="16x16"
        href={withPrefix('/favicons/fav16.png')}
      />
    </Helmet>
  )
}

SEO.defaultProps = {
  lang: `en`,
  meta: [],
  keywords: [],
}

SEO.propTypes = {
  description: PropTypes.string,
  lang: PropTypes.string,
  meta: PropTypes.array,
  image: PropTypes.string,
  keywords: PropTypes.arrayOf(PropTypes.string),
  title: PropTypes.string.isRequired
}

export default SEO

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jun 14, 2019
@gatsbot
Copy link

gatsbot bot commented Jun 14, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@btahir
Copy link
Contributor Author

btahir commented Jun 14, 2019

OK I apologize I just didn't have the time to recreate the example and it was just easier for me to start from scratch. Feel free to close this issue.
I will say that this issue is not specific to my code and plagues a few of your starter templates (mentioned above) and you might want to come back to it whenever you have some free time.

@btahir btahir closed this as completed Jun 14, 2019
@taigfs
Copy link

taigfs commented Jul 4, 2019

Hi @btahir, how did you fix it?

@btahir
Copy link
Contributor Author

btahir commented Jul 5, 2019

Started with another project from scratch - not the ideal solution I know but I was doing enough different things to warrant a version 2.

@wahlforss
Copy link

@btahir @taigfs @DSchau I am having this problem with my site

https://www.bemlo.se/companies/agila

facebook debugger

It is not picking up the og tags! It falls back to bemlo.se. I am using netlify, Contentful and gatsby.

@seba1342
Copy link

bump on this one ☝️
Dynamic page meta tags don't seem to be loading, it falls back to the defaults. I have a feeling this may be something to do with the crawler, because it works fine on the twitter card validator.

@taigfs
Copy link

taigfs commented Sep 30, 2019

@wahlforss In my case it was a matter of time/cache.

There was cache somewhere (my guess is the nginx server) and it started to work 2 days after.

I just opened your link and it's working now, right? Same thing there?

@wahlforss
Copy link

@taigfs
Yes and we also didn't set the canonical urls correct!

@yastrebovb
Copy link

The same issue... Works perfectly with Twitter and Telegram but not Facebook

@winstonma
Copy link

winstonma commented Mar 12, 2020

I got the same issue and solved by using gatsby-plugin-react-helmet plugin. See if this solves your problem.

@rmacuna
Copy link

rmacuna commented Jan 31, 2022

I'm having the same issue. I'm using gatsby-plugin-react-helmet but for some reason the og:image is not detected when the article contains a video (a video page). I'm using jwplayer so I set the thumbnail of the video as the og:image dynamically but twitter and facebook debugger throw me the same error:

"The "og:image" property must be provided explicitly, even if its value can be inferred from other tags."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

No branches or pull requests