-
-
Save dredlong/1bda97e272458723e027527c08f94717 to your computer and use it in GitHub Desktop.
Tapfiliate sales tracking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Rocketship checkout</title> | |
</head> | |
<body> | |
<script src="//static.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script> | |
<script type="text/javascript"> | |
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ | |
(t[a].q=t[a].q||[]).push(arguments)}})(window,'tap'); | |
tap('create', 'Your Account Id'); // Your Tapfiliate account ID | |
tap('detect'); | |
</script> | |
<div class="container"> | |
<h1>Rocketship checkout</h1> | |
<p>Grab your copy of Rocketship app</p> | |
<a id="buy-button" class="btn btn-default">Buy Now!</a> | |
</div> | |
<script src="https://cdn.paddle.com/paddle/paddle.js"></script> | |
<script type="text/javascript"> | |
Paddle.Setup({ | |
vendor: 12345, // Your Paddle vendor ID | |
}); | |
document.getElementById('buy-button').addEventListener('click', openCheckout, false); | |
function openCheckout () { | |
var thankyou_url = './thankyou.html'; // Your thank you page location | |
Paddle.Checkout.open({ | |
product: 654321, // Your product or plan ID | |
successCallback: function(data) { | |
thankyou_url += '?checkout_id=' + data.checkout.id; | |
var order_amount = (data.checkout.prices.vendor.total - data.checkout.prices.vendor.total_tax).toFixed(2); | |
thankyou_url += '&order_amount=' + order_amount; | |
window.location.href(thankyou_url); | |
} | |
}); | |
} | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Thanks for buying!</title> | |
</head> | |
<body> | |
<h1>Thank you!</h1> | |
<p>Thanks for purchasing Rocketship App. Your license key has been emailed to you.</p> | |
<script src="//static.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script> | |
<script type="text/javascript"> | |
function urlParam(name) { | |
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
if (results==null){ | |
return null; | |
} | |
else { | |
return decodeURI(results[1]) || 0; | |
} | |
} | |
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ | |
(t[a].q=t[a].q||[]).push(arguments)}})(window,'tap'); | |
var checkout_id; | |
var order_amount; | |
if (urlParam('checkout_id')) { | |
checkout_id = urlParam('checkout_id'); | |
} | |
if (urlParam('order_amount')) { | |
order_amount = urlParam('order_amount'); | |
} | |
tap('create', 'YOUR ACCOUNT ID'); // Your Tapfiliate account ID | |
tap('conversion', checkout_id, order_amount ); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment