Why we need Shopify App Extension instead of ScriptTag?

DAIVEDevelopers
Shopify Partner
2 0 1
Hi. We have a required update for listing application

>>> Your app is currently using ScriptTag API. Update your app to theme app extensions to ensure compatibility with Online Store 2.0 themes. Refer to this help doc for more context. See this screenshot for details.

Our app adds 2 Javascript files for StoreFront via ScriptTag API after app installation


like for Facebook Pixel or Google Analytics

UNIQUE_ID_FOR_MERCHANT is dynamic and unique per merchant

We don't change any html/css
And question why we need to use App Extension for it? And why we can't use only ScriptTag API?
Replies 2 (2)

JuanGrasso
Shopify Partner
20 3 4

I understand that migrating to App extensions is required because it came with some advantaged and improvements. For example, when you use App extension you dont have to worry about uninstalling the app because it automtically removes all the code that you add to the theme. 
In the past, when you used script tag it was a problem because once the merchant uninstalled the app, you access token was not valid any more to remove the changed you'd made.

dan-motzer
Shopify Partner
1 0 0

This doesn't make sense to me, because my application never once made an API call to remove the script tag upon uninstall. Reason for that was because Shopify already did it automaticallly.