How to avoid 404 page when merchant editing the marketing activity but the App had been uninstalled

New Member
2 0 0

Hi, masters,


I created an extension for my APP, the shop owner is able to create marketing activity based on my APP.

 

If the activity was created, then the shop owner uninstalled my app, the activity still in their marketing campaign.

 

When the shop owner clicks this activity, it would show the page like this:

 


Screen Shot 2019-12-02 at 1.19.42 PM.png404 not found

I expected that would show the page like this, it contained the banner with the notification message telling the shop owner to install the app before using the activity. 

 


Screen Shot 2019-12-02 at 1.19.34 PM.pngShow the notificationHow can I do?

 

Thanks.

Oscar

0 Likes
Highlighted
Shopify Staff
Shopify Staff
139 22 28

Hi @cltsai ,

 

In order to properly investigate this further, could you provide me with the myshopify.com domain name of the Shopify store that is seeing this issue, the name of the marketing activity returning the 404 error, and the name of the uninstalled app? If you would prefer, feel free to DM me this information instead of posting it as a public reply.  

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Shopify Staff
Shopify Staff
139 22 28

Hey @cltsai ,

 

Thank you for providing the information via DM

 

The reason why the 404 Page was delivered was because your app's Marketing Activity was still set to the status of "Active" despite your app being uninstalled. That is why the activity still appears visible within the Marketing Campaign because according to its status it is still "Active", but when the store owner tries opening the activity a 404 error is thrown because the app is disconnected from the store and the specific marketing activity cannot be retrieved. 


From my personal investigation, it appears that the app you have provided a screenshot of with the banner message "{App Name} Isn't Installed. Before you can edit this activity, you'll need to reinstall..." avoided this issue by changing the status of their Marketing Activity to "Paused" after it was uninstalled and then provided the custom error message you see in the banner. To update the status of your Marketing Activity to "Paused", call the GraphQL mutation marketingActivityUpdate and provide the customized error message stating that this activity is paused because your app is not installed. You can read more about this here.

 

The other alternative is that if your marketing app is whitelisted for the feature "with_disconnected_state_support", then upon app uninstallation Shopify will automatically change the status of your Marketing Activities from "Active" to "Disconnected" automatically. Read more about it here. The only caveat to get this whitelist is that your marketing app has to implement functionality for re-syncing the activity status post-reinstall. To get whitelisted for the "with_disconnected_state_support" feature for your marketing app, reach out to Shopify Support directly. 

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes