Add dynamic Javascript

Erezson
New Member
1 0 0

Hi everyone!

I have question regarding Shopify application. I need to add custom remote Javascript to storefront on ALL pages. For example: https://example.com/example.js?param=hash. Where hash - dynamic some unique string we generate for user’s store.
With ScriptTag REST API it is easy task. But Shopify now require to use app blocks. For custom JS it is recommended to use app embed block.

The question here is how can we dynamically add remote Javascript with specific params using embed app block? We already created app embed block and we know user should enable it after app installation, but we don’t understand how can we automatically add dynamic js (so how to pass specific param from our app to app embed block).

Thanks! 

Replies 0 (0)