In case you'd like the user to be redirected to the article they were reading after they've purchased a subscription, you can follow the steps outlined below:
-
Edit your offer templates so that they will have the current URL being passed as a parameter:
HTML<a ng-href="http://example.com/subscribe?redirect={{params.url | encodeURIComponent}}"><span class="pianoCTAButton">Subscribe</span></a> -
On the Subscribe page, the
checkoutCloseevent should capture that parameter and redirect the user:tp.push(["addHandler", "checkoutClose", function (event) { if (event && event.state == "checkoutCompleted") { var url_params = new URLSearchParams(location.search); var return_url = url_params.get("redirect"); if (return_url) { location.href = return_url; } else { location.reload() } } }]);
In some cases, the above steps might not be working. This can happen for a few reasons:
-
There is a default callback handler in your load script that refreshes the page.
Unless you remove it - it’ll keep reloading the Subscribe page instead of redirecting to the article.
-
There is a timeout function in your load script.