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

Highlighted
Shopify Partner
3 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:

 


404 not found404 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. 

 


Show the notificationShow the notificationHow can I do?

 

Thanks.

Oscar

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

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
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

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.

 

{Redacted}

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
Highlighted
Shopify Partner
6 0 0

Hi @hassain , thanks for the advice.

 

We have tried that before, but isn't the Access Token invalid once the user uninstalled the app? Then we can not modify the status anymore without the valid token.

0 Likes