I'm trying to add custom HTML to the product page via API. Working good
but I've faced with the problem that themes are different and I can't know all positions of elements
for example, I need to add HTML right after the product title on the product page and in the catalog product listing
and I'm wondering if there some rules that can help me define where are these elements?
maybe some class that will be there in all themes
I'm trying to find some regularity that will help me to find these elements on all themes
and I can parse HTML and insert it there
I hope you are well. You can use script tag API for that. (https://shopify.dev/docs/admin-api/rest/reference/online-store/scripttag)
You can follow the below steps:
<div class="customhtmlinjector"></div> or <div id="customhtmlinjector"></div>
This is the Only way I found till now.