Drupal 8 Metatag and Media Entity modules to set meta image tags On a Drupal 8 content type, I have a field with an entity reference field to a Media Entity field.  I would like to use the Metatag module to set the image that is on this Media entity in the og:image meta tag.


Featured Image - [node:field_im] - Returns the entity name
Featured Image type with delta 0 - [node:field_im:0] - Returns the entity name
Media - [node:field_im:0:entity] - Returns the entity name
Media ID - [node:field_im:0:target_id] - Returns the entity ID


In Drupal 7, the following token was available:

[node:field-fimg:0:file:url]

But I don't see anything like it in D8.  Could someone point me in the right direction?
If I understand your question correctly you'll need to do the following:

Check on your modules page that the &quot;Metatag: Open Graph&quot; submodule
is enabled.
Go to metatag config page (Configuration &gt; Search and
metadata &gt; Metatag).
Add a new &quot;default metatag&quot; and select your
content type in the &quot;Type&quot; selectbox.
Fill in the rest of the fields similar like following picture (just don't forget to use your own field names:


Here are some things you need to know about my tokens:

field_teaser_img: is the fieldname of my media entityreference on my
content type.
field_me_img: is the fieldname of my image field
on my media entity type.
facebook: is the imagestyle name I
created for these metatags
height, mimetype &amp; width: are
property fields of the media entity type yet I didn't create those
fields but it does seem to work.

I hope this helps.