How to update the og:image meta tag for various pages?

I have an app embed extension that renders an og:image meta tag to control what’s displayed for social app link previews. That’s the goal anyway.

The problem is that this is appended to the so now the html contains two og:image tags

  • the one provided by the store’s theme(meta-tags.liquid)
  • the one added via my app embed

Social apps only use the first og:image tag they find though so my app embed is useless. I’m currently in a review process for my app but getting pushback because i have instructions for the user to manually update their meta-tags.liquid file. The reviewer wants this all to be automated(as do i for that matter).

It would be great if you could:
A) Control if the app embed is prepended instead of appended.

B) Control which og:image url is used for various pages via api.

Are there any existing solutions to control the first og:image meta tag for various pages outside of using the assets api which you have to apply to get access to?

Hi Dadamssg,

The only way to change the existing code in the theme via an app would be with the Assets API - otherwise you’d need to have the merchant do this manually which is not a great experience. Have you applied to get an exception for using the Assets API?

Hey Liam

Yes, i did apply and was not approved. I agree it’s not a great experience for the merchant but there’s literally no other way outside of the Assets API. I would much prefer to use a Shopify api to update social images on a per page basis than use the Assets API or ask the merchant to fiddle with theme code.