I can't get my AMP pages to pass in the google structured data testing tool.

I have set AMP metadata content image but this info is not pulling through into the schema.

Details in AMP metadata

Content image token:	[node:field_amp_image]
Content image style:	image.style.amp_metadata_content_image_min_696px_wide

Image is a required value but not pulling through into schema

<script type="application/ld+json">{
    "@context": "http://schema.org",
    "@type": "BlogPosting",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "http://www.matt-harris.net/notes/how-vertically-align-image-within-div-varying-text-length"
    },
    "headline": "How to vertically align an image within a div with varying text length",
    "author": {
        "@type": "Person",
        "name": "Matt Harris"
    },
    "datePublished": "2012-12-28T10:43:11+00:00",
    "dateModified": "2016-05-10T13:48:57+01:00",
    "description": "\u003Cp\u003EA while back I was building a web page from a mock up the designer had sent me. There were four sections each containing an image and a parag...",
    "publisher": {
        "@type": "Organization",
        "name": "matt-harris.net",
        "logo": {
            "@type": "ImageObject",
            "url": "http://www.matt-harris.net/sites/default/files/amp/logo-amp.png",
            "width": 60,
            "height": 60
        }
    }
}</script>

Comments

matt-harris created an issue. See original summary.

rainbowarray’s picture

Things to check:
- Double-check that the post you're looking at is a content type that has field_amp_image.
- Double-check the field display settings for field_amp_image on that content type (either for AMP display mode or for Token display mode if that's turned on).
- Make sure that for the display mode the field is set up to show. Should be fine if it's either returning an img element or returning a full URL.
- Double-check that the post has a field_amp_image.

Hopefully you'll find something in one of those items that might be helpful in getting this working.

matt-harris’s picture

Status: Active » Closed (fixed)

Hi

I updated to 8.x-1.0-rc1 and it now displays image metadata.

Thanks for your help and please close this issue.

erku’s picture

not all of our images convert to amp image. what could be the problem?

thank you
armen

leovw’s picture

I have been experiencing the same issue as above of the amp image not showing in the head. It seems to happen when the image has spaces in the filename so manually removing the spaces from the image name fixes it but this obviously isn't an ideal solution. I know the transliteration module fixed this in D7 but this now appears to be baked into core but doesn't have quite the same functionality or customisability.

erku’s picture

Hi Leovw, Transliteration is running on my Drupal 7, but it doesn't solve my issue. Are there any other suggestions everyone?

Thank you

erku’s picture

Are there any updates on this?

Here is the error I keep seeing

https://search.google.com/structured-data/testing-tool?url=https%3A%2F%2...

thank you.

mayank_kanungo’s picture

#2 Help me.

@mdrummond Thanks,

Edit Content type setting and Check AMP Metadata at bottom of the page.
Check Article image for carousel and Article image style these fields are responsible for image in AMP metadata.

Thanks,