Description of issue:
Card image is not populating with Twitter Card Validator (or in a tweet), but it is working perfectly fine on Facebook (and in their Sharing Debugger).
URL affected:
https://whattoexpect.pen.org/pledge-wall/?u=8lyvATPpDCQYUZp4zIfRFJPG5jb2
Troubleshooting steps::
We’ve included a variety of metatags, including:
og:image — https://us-central1-pen-america-quiz.cloudfunctions.net/screenshot?url=https%3A%2F%2Fwhattoexpect.pen.org%2Fsocial-pledge%2F%3Fu%3D8lyvATPpDCQYUZp4zIfRFJPG5jb2
og:image:width — 1200
og:image:height — 630
twitter:image — https://us-central1-pen-america-quiz.cloudfunctions.net/screenshot?url=https%3A%2F%2Fwhattoexpect.pen.org%2Fsocial-pledge%2F%3Fu%3D8lyvATPpDCQYUZp4zIfRFJPG5jb2
twitter:image:width — 1200
twitter:image:height — 630
og:title — What to ...
og:description — This fall, ...
og:url — https://whattoexpect.pen.org/pledge-wall/?u=8lyvATPpDCQYUZp4zIfRFJPG5jb2
og:type — website
twitter:card — summary_large_image
twitter:site — @PENamerica
twitter:creator — @PENamerica
The site is hosted on Netlify, built with Gatsby, and uses Netlify’s Prerendering (which in turn uses prerender io) to serve prerendered pages to bots. Additionally, the og:image URL points to a firebase cloud function that generates the image on the fly (which consistently takes about 2.5 seconds).
Facebook has no problem rendering this stack, and there were 2-3 instances where Twitter did actually grab the correct image and tweet it, so I’m not sure where the issue lies.
Interestingly, the other variety of shares on the site is working as expected, using the same tech stack, meta tags, and image-generation cloud function:
https://whattoexpect.pen.org/quiz?q=family-shares-story
When a user signs up, they’re assigned a userID, and this string is what is fed into the url in the u param in the original url.
The card validator doesn’t show any error, and if we look at the JSON returned from the validator, it has three errors that seem somewhat related:
twitter:image:id: "Unknown aspect ratio",
twitter:text:photo_image_full_size_alt_text: "Required meta tag missing",
twitter:text:summary_photo_image_alt_text: "Required meta tag missing",
From the troubleshooting doc, we’ve confirmed:
- meta tags are all in the source
- source contains the correct twitter:card tag
- when
curling with -A Twitterbot, the site returns 200 and still contains that tag
- while the tags are technically dynamically generated, Twitterbot (tested via
curl) receives all the prerendered tags correctly (thanks to Netlify’s prerendering)
- same situation if we
curl the actual image in question
- there is no robots.txt
- we are not using a CMS like Wordpress
- we are putting the correct url into the validator (
https://whattoexpect.pen.org/pledge-wall/?u=8lyvATPpDCQYUZp4zIfRFJPG5jb2)
- the url is absolute and full (see above), and the param that contains a url is also encoded (originally it was not encoded, but it seems not to work either way)
- there are no errors in the validator, except for the fields in the JSON (see above)
Any idea what on earth we’re doing wrong?