Lost income due to COVID-19? E-junkie is providing 1 year free accounts to sell anything, anywhere. Click Here for more details.

E-junkie Help >

Inserting a download link into a thank-you page on your own Web site

« Return to Redirection after payment

Suppsoe you prefer to redirect buyers to a thank-you page hosted on your own Web site, and yet still display E-junkie download links in your site's thank-you page. This can be done when you redirect to a Common Thank-you Page URL (set in Seller Admin > Manage Seller Account > Edit Preferences), but that thank-you page on your site would also need to have an IFRAME with its src= URL set to:

https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id=TXNID

...where CID is your E-junkie client ID number (which you can find in Seller Admin > Manage Seller Account > View Account Summary) and TXNID is the unique value for txn_id= that we append to your thank-you page URL during each redirection.  Since the value for txn_id= is unique for each transaction, you would need to add some custom scripting in your thank-you page, which would grab the txn_id= value from the page's own URL for each visit and insert that value at the end of that IFRAME src= URL (see below for code examples to accomplish this).

If you want to customize what gets displayed inside that IFRAME, you would need to customize your E-junkie thank you page. For instance, you may want to add some custom CSS to your E-junkie-generated thank-you page (a good place for this would be Seller Admin > Manage Seller Account > Edit Preferences > Common Thank-you Page HTML), so the IFRAME content would better resemble the styling of your own site's thank-you page where the IFRAME is embedded.

Disabling product-specific emails/links

Any product-specific thank-you emails sent for download products would by default carry a link to the E-junkie-generated thank-you page for that product, rather than redirecting to your site's Common Thank-you Page URL. If you want to make sure your buyers would only ever see your site's custom thank-you page with IFRAME-embedded download links, either:

  • Don't include default greeting and link/code for each product and then include the code [%thankyou_link%] (ideally on a line by itself) in your product's Email Message template, which would insert a link that activates your Common Thank-you Page URL redirection;
    ...OR...
  • Un-tick the box for Product Thank-you Email; buyers would still receive your Common Thank-you Email, which should include the [%thankyou_link%] code to insert a link that activates your Common Thank-you Page URL redirection.

Hiding e-junkie.com in your thank-you page links

You can override any E-junkie.com thank-you page links we'd insert in your thank-you emails, and instead provide a link directly to your site's thank-you page with the TXNID appended as necessary to enable the embedding technique described above. To do this in your Common Thank-you Email, delete the [%thankyou_link%] template tag from your Common Thank-you Email template in Seller Admin > Manage Seller Account > Edit Preferences, and replace that with your site's Common Thank-you Page URL followed by ?txn_id=[%txn_id%] -- e.g., if your site's thank-you page is at http://www.example.com/thanks.php, you'd put that in your thank-you email like so:

http://www.example.com/thanks.php?txn_id=[%txn_id%]

To do this for product-specific emails as well, edit each product and tick Don't include default greeting and link/code, which will have the Email Message you provide there completely replace (rather than merely being added to) our standard message and link presentation, so you can include the link as described above in your message template. You could also just un-tick the box for Product Thank-you Email Message to disable this message, so buyers would only receive your Common Thank-you Email regardless of the item(s) they purchase.

Code Examples

Using PHP:

Some PHP like this should insert the IFRAME into your page before it gets served to the buyer's browser (note where you'd need to replace CID with your own E-junkie client ID):

<?php
echo '<iframe src="https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id=' . htmlspecialchars($_GET["txn_id"]) . '" style="width:100%;border:0;min-height:500px;"></iframe>';
?>

NOTE: If you are using WordPress, you may need to use a special WP plugin to ensure our PHP code gets inserted correctly. The following plugins may be useful; you should be able to search for and install any one of them from your WP Admin panel: Insert PHP, PHP Code Widget or Insert PHP Code Snippet.

Using JavaScript:

If you're not familiar with using PHP, you could paste this JavaScript (note where you need to replace CID with your own E-junkie client ID) into your site's thank-you page wherever you want the buyer's browser to add the IFRAME after it gets served to them:

<script type="text/javascript">
<!--
function gup( name )
{
 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
 var regexS = "[\\?&]"+name+"=([^&#]*)";
 var regex = new RegExp( regexS );
 var results = regex.exec( window.location.href );
 if( results == null )
 return "";
 else
 return results[1];
}
document.write("<iframe src=https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id="+gup('txn_id')+" style='width:100%;border:0;min-height:500px;'></iframe>");
// -->
</script><noscript>This page requires JavaScript to display your download link. You can either enable JavaScript in your browser and reload this page, or contact the seller to get a direct link to a download page that will work without JavaScript.</noscript>

NOTE: this JavaScript method will not work for buyers who have disabled JavaScript in their browsers, so if they contact you about it, you may need to generate a link manually from Seller Admin > Manage Buyers > Send Free Download Link, copy the link generated there, and paste that into a personal email to the buyer.