Have you followed a link to buy something on Facebook or Instagram, and when you click on the Buy Now / Add to Cart button on the website, you are greeted with a “404 Error. This page couldn’t be found.” on the PayPal website? Are you using an iPhone or and iPad? We found a really quirky meta->website->PayPal Smart Button code issue. PayPal gives you the code to embed on your website as:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
We found a stackoverflow post from 2015 where someone said the when the link to the website is clicked from Facebook, then they click on the Buy Now button, it took them to the PayPal login page. The answer was to change the target=”_blank” to target=”_self” in the above form code. We decided to try it with our 404 error issue, and it worked!
PayPal’s response in their knowledgebase regarding this issue was to clear your cache. Clearing your cache does not fix the issue.
We suspected that the issue could be related to a security feature with the iOS. And, it turns out that not only is the _blank link attribute a security risk, but there are also multiple situations when using something other than _blank is recommended. In this case, we are referring to the fact that the PayPal SmartButton actually doesn’t work correctly as given with the continue shopping link, and appears to be geared towards opening a new page to PayPal. If the button is configured correctly, there is no reason to open a new page (tab) on the browser. Always create the cancellation page as well as the thank you page to automatically be returned to the website where the viewer is shopping. We also added the following so that if continuing to shop, the button returns to the page to add to the cart. This is added at the bottom of the page in the Advanced Variables box when creating or editing your button: