PayPal recurring payments via Zapier
David Rolenc avatar
Written by David Rolenc
Updated over a week ago

This Paypal integration guide is created for websites that use PayPal as the only payment provider. And applies to cases of recurring payments.

In order to successfully integrate tracking of your PayPal payment provider you will need to set up your system by instructions in the Quick setup section in the system and then by tracking for clicks and conversions by following the guide below.

Setup part of the website

  1. Add a click script to your landing pages. Click tracking code needs to be placed on every page of your website. Make sure that it is placed in the <head> tag, ideally as high as possible.

    <!-- Trackdesk tracker begin -->
    <script async src="//cdn.trackdesk.com/tracking.js"></script> <script>
    (function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");

    trackdesk('YOUR TENANT ID', 'click');
    </script>
    <!-- Trackdesk tracker end -->

    Make sure to replace YOUR TENANT ID with your actual Tenant ID. It can be found at the bottom of the Settings page
    ​

  2. Set up a connection of customer email to the click

    Add the following snippet to a page on your website after you acquire an email of the customer, for example, to a thank you page after a payment that redirects to your domain.

    <!-- Trackdesk tracker begin -->
    <script async src="//cdn.trackdesk.com/tracking.js"></script>
    <script>
    (function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");

    trackdesk('YOUR TENANT ID', 'externalCid', {
    externalCid: 'YOUR_EXT_CID',
    revenueOriginId: 'YOUR_REVENUE_ORIGIN_ID'
    });
    </script>
    <!-- Trackdesk tracker end -->

    Make sure to replace YOUR TENANT ID with your actual Tenant ID.
    Make sure to replace YOUR_EXT_CID with the email of the customer.
    Make sure to replace YOUR_REVENUE_ORIGIN_ID with your actual Revenue origin ID. It can be found at the bottom of the Settings page.

Set up a Zapier integration

With Zapier we will handle creation of conversions, both the first one and recurring ones.

Zapier setup will consist of three parts - Trigger, Pause and Action.

Trigger

As a trigger you will select PayPal app and event Successful sale with line items (there are two options for event named same way) and continue to the next step.

In the next step Test follow the link that is present under the webhook URL - PayPal IPN settings and copy the shown link there.

Once added in your PayPal admin you can use Test trigger and then Continue with selected record.

Once this is done you can move to the next section Pause.

Pause

After trigger is completed, you will select to add a new action Delay by Zapier.

This action is added as in some case it is possible that request to create a conversion would reach the system before the necessary information are present in the system.

You will select event Delay for and in the next step value 5 and unit minutes. Choosing 5 minutes is only an example, even less should be completely enough, but better to be safe.

Next you will follow with a test and move to the next section Action.

Action

After Pause action is completed you will click + sign in the Zap visual navigation to add a new Action.

You will select Trackdesk app and event Create Conversion, and continue to the next step.

Now you will connect your Trackdesk account in section account, by filling your Tenant ID and API key, both of these two information can be copied in Settings of your program.

Next you will fill the Action itself, following parameters are required to fill.

  • External CID - You will select variable Payer Email from the PayPal step

  • Amount

    • If you selected percentage payout on the offer you will need to fill the amount from which Affiliate payout will be counted

      • In this case you will select variable Mc Gross from the PayPal step

    • If you selected fixed payout on the offer you can skip filling of this step as the payout for affiliate is already set on the offer in the system

  • Conversion type code - You will select a conversion type you would like to create conversion with, most likely this will be "sale", "lead" or any other conversion type that you created

  • External ID - In case you would like to follow creation of conversions with solution for refunds that is specified below, you will need to select a variable Txn Id from the PayPal step, if not, you can skip filling of this step

  • Revenue origin ID - This information can be found on the bottom of the Settings page in your Trackdesk system

Variables from previous steps are filled in following way:

1. Click a field

2. Select a step you want to use variable from

3. select a variable.

In the example screenshot below we add Payer Email from PayPal step to the External CID field.

After all the information are filled the step will look like this, only with different values.

Last part needed is to go through a test, complete the step and Publish the Zap.

Optional part: How to handle PayPal refunds with Zapier

In order to handle refunds you will create another Zap in your Zapier profile.

This zap will consist of three parts - Trigger, Pause and Action.

Part one and two will be completely same, with a change that in part one you will select event Refunded Sale.
​

After part one and two are set you will follow with part three - Action.

Action

Click + sign in the Zap visual navigation to add a new Action.

You will select Trackdesk app and event Change Conversion Status by External ID, and continue to the next step.

Now you will connect your Trackdesk account in section account, by filling your Tenant ID and API key, both of these two information can be copied in Settings of your program.

Note that if you previously did the connection of conversions above in the guide, this step will be already completed, so you can just continue through this step.

Next you will fill the Action itself, following parameters are required to fill.

  • Conversion status - you will select a status to which conversion will be moved when a refund occurs, best case is to use Rejected or Refunded

  • Conversion type code - You will select a conversion type that you are creating your conversions with, most likely this will be "sale", "lead" or other conversion type that you created and used

  • External ID - Select a variable Txn Id from the PayPal step

  • Revenue origin ID - This information can be found on the bottom of the Settings page in your Trackdesk system

After all the information are filled the step will look like this, only with different values.

Last part needed is to go through a test, complete the step and Publish the Zap.


​

Testing Your Integration

Please remember to test the creation of click and conversion before starting your program. This way you can verify that tracking has been set up correctly. You can create a test click and conversion by following the steps described here.

Did this answer your question?