Custom delivery of content

If you would prefer to handle delivery of your own products, you can set a redirect URL instead of uploading files from a product's edit page. This lets you redirect customers to a URL you choose after their successful purchase. 

Go to the product's "Content" tab, toggle off the "Beta content editor" by clicking the switch on the top-right, and select "Redirect to a URL after purchase" and type in whatever URL you'd like to direct your customers to.

For example, if you specify: https://www.example.com/ — all of your customers will be redirected there upon successful purchase, instead of seeing our download page or the "View content" button in their receipts.

The following information about the purchase is appended to the URL above. If your URL already includes a query string, we will add the information intelligently to not override them:

  • sale_id
  • product_id
  • product_permalink

Custom Delivery in Overlays/Embeds

For better or worse, the Custom Delivery method will not redirect the customer if the purchase is from an Overlays or Embed. The overlay/embed is technically a sub-page on your page so ideally speaking we should not change the outer page when something happens in the inner page.

To make it work for overlay/embeds, you will have to use the  post_message_name feature. Basically it gives you a hook to do something after a purchase happens in the overlay:

<script type="text/javascript">
  var gumroadSaleListener = function(ev) {
    if (ev.data && JSON.parse(ev.data).post_message_name == "sale") {
      document.getElementById("post-message-data").innerHTML = ev.data;
      // Do something else here...
    }
  };
  window.addEventListener("message", gumroadSaleListener, false);
</script>
	
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us