I get inspired by people like Pieter Levels Ruben Gamez, DHH, and Rob Walling, among many others. I recently read Rob Walling's The Stair Step Method of Bootstrapping and thought I'd give that a shot with building a Shopify plugin. I don't know the first thing about effective marketing. I don't have a huge twitter audience or mailing list. The built-in marketing from the Shopify app store was really appealing to me and my lack of marketing skills.
The Idea
Most Shopify product pages have a gallery of images for each product. A set of photos for the same product. Shopify will use the first of those images for the Open Graph images. These photos are also usually portrait oriented(taller than they are wide). This tends to result in the images getting cropped in funky ways leave you with social impressions that leave a lot to be desired. Here's an example.
What you see on social media:
And the actual product:
I thought this would be an interesting problem to tackle so I began to build an app the would generate branded OG images for each product automatically that actually showcased the product in a much more flattering way.
The development
I was really attracted to Shopify because it meant I could use Remix, the react framework I most comfortable and productive with.
The Remix aspect was great. Learning the Shopify ecosystem and sdk's was like drinking from a disjointed fire hose though. I encountered several really confusing things:
- webhooks
- subscribing via yaml and/or the
shopifyApp
remix utility
- at the time debugging payloads was a headache. It looks like that's gotten better.
- unsubscribing
- I would get development emails about webhook subscriptions failing but never knew how to unsubscribe those.
- apis
- some things are in the REST api
- other things are in the GraphQL api
- development via tunnel
- sometimes this would just fail to launch so I'd need to restart it randomly
- you can't develop offline because it gets rendered into the Shopify admin site
- when you start the app in development a new tunnel is created and this automatically updates your app's configuration to point to it. You have to remember to manually switch this over to your production url or else you're at risk of the reviewer using your development tunnel
- billing
- you have to implement your own UI to change plans even though you're supposed to define them in your app config and in the listing
billing.request()
's returnUrl
was not documented at all. This looks like it's been updated in the docs.
- the
authenticate.
vs unauthenticated
api's and when to use each
It's probably just the nature of Shopify's ecosystem having grown to be so big, but I found myself bouncing around all over completely different sets of docs.
By default, in the themes I came across there is a meta-tags.liquid
snippet that renders the meta tags for og:image
, title
, description
, etc. This gets used in the main theme.liquid
file.
In my app's onboarding, I was instructing the user to edit their meta-tags.liquid
file to use OG images from my app rather than what's used by default, the shopify cdn.
I found no other way to programmatically update the OG images. Shopify doesn't have a means for users, or developers, to assign specific OG images per product which was very surprising to me. You can set a custom OG image but the same image would be used for every link to your store. Oh well, I'll just settle on instructing the user how to update their theme file I thought... (foreboding music begins to play)
Getting ready
Finally, after spending several evenings getting an app together I was ready to submit the app for review. This involved putting together an app listing page. On the surface that doesn't sound like a big task but when you're lacking in the marketing department it can be tough coming up with app visuals, blurbs, feature lists, logos, app icons, etc. There's a lot more to it than I initially anticipated.
App review
A few days later after I submitted the app I received my first kickback from Shopify which I expected. There's a lot of requirements, not just in the app listing but the app itself. They have an actual person review the listing and attempt to use your app in a demo store.
There were some easy to fix app listing issues I tackled and some billing items that I needed to flesh out more. No problem. The biggest issue was the reviewer telling me that instructing the user to edit theme files to enable my app is not a good user experience and to use "app embed blocks". I hadn't come across them yet and it looked like exactly what I needed. Sweet.
I quickly implemented an app embed block that would inject markup into the <head>
. This markup would contain the meta tags for the OG images but there was a problem... When using app embed blocks, your app's markup gets appended to the existing content in the <head>
. It ends up looking like this
<head>
<meta charset="utf-8">
<!-- BEGIN rendering `meta-tags.liquid` -->
<meta property="og:image" content="https://cdn.shopify.com/s/files/1/2341/3995/files/some-product-image.jpg?v=1720565083" />
<meta property="description" content="blah blah blah">
<!-- more stuff... -->
<!-- END rendering `meta-tags.liquid` -->
<!-- BEGIN app block: shopify://apps/your-apps-name/blocks/your_block_name/e512386f-5389-4282-aadb-21c442089ea -->
<meta property="og:image" content="https://your-app-domain.com/images/product-123" />
<meta property="description" content="blah blah blah">
<!-- END app block -->
</head>
The show stopping problem is that social sites only use the first og:image
that's rendered and if you don't stop the meta-tags.liquid
file from doing that then that's what's going to be used. The app embed block is going to be worthless unless I can prevent Shopify's theme from rendering the og:image
tag.
So armed with that knowledge, I updated the onboarding to comment out a single line from the meta-tags.liquid
file. This would allow my app embed block's og:image
tag to actually be used since it would be the only one rendered in the markup. My new onboarding instructions and image:
- Comment out the line
- Save the theme file
I deployed my changes and then sent off a reply explaining everything I fixed and how I was now using an app embed block like he suggested but I still had to instruct the user to comment out a line in one of their theme files.
I received a reply and it was at this point that I knew this project was headed for the bin. The reviewer turned into a parrot who kept repeating the same thing during a series of back and forth emails: I needed to not instruct the user to edit theme code and instead accomplish it via app embed code. I repeatedly attempted to explain my dilemma and asked for guidance but was simply told to use the help forum and that reviewers are not responsible for help with code but that I could apply to be able to use the Assets API which allows apps to automatically update theme files. That went nowhere. The back and forth with the reviewer became almost like talking to AI chatbot who kept repeating the same recommendation of using app embed blocks and not instructing the user to edit a theme file even though I've repeatedly explained why that was insufficient.
Even more frustrating is the fact that there are apps in the app store that provide a means to update OG images. When I brought this up to the reviewer I was simply told that the rules have changed. That's a pretty amazing moat for those older apps...
Lessons learned
It's really easy to get incredibly frustrated by this situation but I have to remind myself that no matter what new thing I'm trying, I'm always learning and adding to my toolkit.
- I've checked another idea off the list of things to try. I'm a doer, not a talker.
- I now have some familiarity with the Shopify development ecosystem.
- I've given my marketing muscle a workout when putting together the listing page.
- I've experienced first-hand why should launch ASAP and fail fast so you can move on to the next thing.
- I've gained an even deeper respect for indie developers who are actually to make this work.
- I've learned about MX Route(not affiliated) and now have a lifetime email service for any future app ideas I want to attempt to make work. I've eased that inevitable friction a bit.
If by the off chance someone from Shopify reads this, I would love to be part of a pilot program that allows developers to update OG images per product when that get's implemented. 😀 Or, if anyone knows of someway to do this that I somehow missed, I would love to chat. Reach out to me here, on 𝕏, or Bluesky!