Simple app to add script tag to store

Nick_Hoddinott
Shopify Partner
1 0 0

I'm new to Shopify but an experienced developer. I'd like to create an app that simply adds a script tag to someone's store. The script tag is for my startup which allows customers to easily get user feedback on their shop, run surveys and give customer support nudges.

I've looked at various Shopify app tutorials but I'm still not totally sure how to do this.

- Is this possible? Could anyone give me some pointers?

- Are there any relevant app guidelines that I should be aware of given what I'm trying to achieve?

Replies 3 (3)

Andy_Lower
Shopify Partner
45 0 7

Hey Nick,

You can indeed. Take a look a the link below. I'm assuming you've got as far as this? Have you dealt with installing the app on a store/authorisation etc?

Basically, you tell Shopify where to add the script tag and the URL for that tag. Include all your JS code in the specified file and you're good to go.

https://help.shopify.com/api/reference/scripttag#create

Thanks,

Andy

Kind regards, Andy Lower PandaCake Shopify Partners
MistyU
Visitor
1 0 0

Hello, I'm confused how script_tag in shopify works. I did POST in script_tags.json of my shopify store. I am using reactjs with polaris as UI. I'm not sure what to include in the "scr" of the script_tag. How to serve my js file so that it can be seen in the storefront. By the way, I am using ngrok to tunnel my app. Can someone share ideas how to do this? Thank you

jambo1
Shopify Partner
2 0 0

Hi Did you find an answer to this? I am trying to figure out how to add a script tag on the users store from my shopify app when the user clicks a button, I'm using the example react-shopify app that they give in the learning docs 

https://shopify.dev/docs/apps/getting-started/build-app-example

Please help! I couldn't find a clear answer to this.