PayPal Smart buttons
Integrate PayPal Smart Buttons with Post Affiliate Pro for seamless click and sales tracking. Set up one-time payments or subscriptions easily by following steps for click and sale tracking codes. Enable PayPal plugin for recurring transactions.
PayPal Smart buttons integration
PayPal’s Smart Payment Buttons keep your site’s buttons up-to-date by ensuring you have the latest payment options and button styles.
PayPal Smart buttons gives you two options – to create a one time payment button or a subscription button. You can use this integration for both.
The integration consists of two main steps – the clik tracking code and the sale tracking code.
Click tracking code
You can find your click tracking code in your merchant panel Tools > Integration > Click tracking. Copy the code and place it to every page where you have a PayPal Smart button you want to integrate.
Sale (button) tracking
The sale tracking code has to be added into each of your Smart buttons. The code goes to ‘onApprove‘ section of the button code. In case your button does not use it, create it. The buttons should look like this:
<div id="paypal-button-container-P-NNNNN"></div>
<script src="https://www.paypal.com/sdk/js?client-id=XXXXXYYYYYZZZZZ&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'silver',
layout: 'vertical',
label: 'paypal'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'P-NNNNN'
});
},
onApprove: function(data, actions) {
// THE TRACKING CODE GOES HERE
}
}).render('#paypal-button-container-P-NNNNN'); // Renders the PayPal button
</script>
The sale tracking code will automatically read the new order/subscription ID. The price and the product ID has to be defined manually by you. Here’s the code to be used:
// [Post Affiliate Pro](https://www.postaffiliatepro.com/ "Post Affiliate Pro offers a comprehensive affiliate software platform to manage multiple affiliate programs with ease. Enjoy no setup fees, 24/7 customer support, and a free 1-month trial. Ideal for small and large businesses, it features precise tracking, automated workflows, and customizable tools to boost your affiliate marketing success. Try it now and streamline your affiliate operations effortlessly!") integration code
var sale = PostAffTracker.createSale();
sale.setTotalCost('123.45'); // the price goes here
sale.setProductID('P-NNNNN'); // plan ID goes here
if (typeof data.subscriptionID !== 'undefined') {
sale.setOrderID(data.subscriptionID);
} else {
sale.setOrderID(data.orderID);
}
PostAffTracker.register();
That’s it. If you only want to track one time payment you do not have to enable PayPal plugin and you do not have to setup notification URL.
Recurring transactions tracking
To track recurring commissions you have to enable the PayPal plugin and you also have to setup this notification URL in your PayPal:
https://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php
If you already use notification URL for another script you can still make the integration working. Take a loot at the section 3. in this guide:
Frequently asked questions
- What are PayPal Smart Buttons?
PayPal Smart Buttons are customizable payment buttons that allow you to offer the latest payment options and button styles on your site, supporting both one-time and subscription payments.
- How do I integrate PayPal Smart Buttons with Post Affiliate Pro?
Add the click tracking code to every page with a PayPal Smart Button, and include the sale tracking code in the button’s onApprove section. This setup lets you track payments and subscriptions through your affiliate program.
- Can I track recurring transactions with this integration?
Yes, by enabling the PayPal plugin and setting up the notification URL in your PayPal account, you can track recurring commissions in Post Affiliate Pro.
- Do I need to enable the PayPal plugin for one-time payments?
No, if you only want to track one-time payments, you do not need to enable the PayPal plugin or set up a notification URL.
Lucia is a talented content editor who ensures the seamless publication of content across multiple platforms.

Boost Your Affiliate Payments with PayPal Smart Buttons
Integrate PayPal Smart Buttons with Post Affiliate Pro for seamless affiliate commission tracking on both one-time and recurring payments.