Skip to main content

How to Integrate WordPress with Tapfiliate

This guide walks you through connecting your WordPress website with Tapfiliate using the official plugin and shortcode.

Sonya avatar
Written by Sonya
Updated over a week ago

In this article, we will cover:

Overview of Wordpress Integration

Tapfiliate makes it easy to bring powerful affiliate tracking to your WordPress website. Simply install our lightweight plugin and configure the redirect on your “Thank You” page with query parameters. Then use our shortcode to capture affiliate-driven conversions. This is perfect for businesses selling physical or digital products directly on WordPress.

With this WordPress integration, you can:

  • Track affiliate-driven visits and sales

  • Attribute commissions (based on order amount) automatically

  • Monitor performance in real time

A few things to know:

  • Tracking runs when the customer lands on your WordPress Thank You page and the necessary URL query parameters are present.

  • Features like subscription renewals, multiple currencies, coupon-code attribution, lifetime/recurring commissions aren’t handled automatically by this basic plugin + shortcode method.

Prerequisites of Integrating with wordpress

To successfully integrate, ensure you have the following:

  • A Tapfiliate account and your unique Account ID.

  • A WordPress site where you can install plugins.

  • Your WordPress site must be running PHP version 8.0 or higher. Older PHP versions are not supported by the Tapfiliate plugin.

  • A “Thank You” page in WordPress, this is the page users are redirected to after completing payment or checkout.

  • Your checkout or redirect process must pass query parameters (e.g. amount, invoice_id) in the URL when redirecting to the Thank You page.

Integration Steps to be completed

1. Install the Plugin

1. In your WordPress dashboard, go to Plugins → Add New.

2. Search for “Tapfiliate”.

3. Click Install and then Activate the plugin.

2. Configure the Plugin

  1. In WordPress Admin, navigate to Settings → Tapfiliate.

  2. Enter your Tapfiliate Account ID.

  3. Click Save to store your settings.

3. Configure Redirect URL with Query Parameters

After checkout, configure your payment processor or system to redirect the user to a URL like:

  • sub_id, invoice_id, and amount are query parameters carrying the conversion data.

  • Ensure the Thank You page resides on your WordPress site and includes those parameters.

4. Place the Shortcode on the Thank You Page

Edit your WordPress Thank You page and insert this shortcode where you want tracking to occur:

[tapfiliate customer_id_query_param="sub_id" external_id_query_param="invoice_id" amount_query_param="amount" currency="USD"]

This tells Tapfiliate:

  • customer_id comes from the query parameter sub_id

  • external_id comes from invoice_id

  • amount comes from amount

  • currency is explicitly set to USD

If you want to pass currency dynamically via the URL, use the argument:

currency_id_query_param="currency"

You can also view our instruction video on how to integrate your wordpress account with Tapfiliate.

Advanced or Optional Features

1. JavaScript-Based Integration (Instead of Plugin)

If you prefer not to use the Tapfiliate WordPress plugin, you can integrate Tapfiliate manually using JavaScript.

You’ll need a third-party plugin that allows custom code snippets to be added to pages.

We recommend using WPCode (previously known as Insert Headers and Footers).

Steps:

1. Install WPCode from your WordPress dashboard (Plugins → Add New → Search “WPCode”).

2. Add the detect code to all pages:

  • Create a new header snippet in WPCode.

Paste this code:

<script src="https://script.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', { integration: "javascript" });

tap('detect');

</script>

Save and make sure it loads site-wide in the header.

3. Add the conversion code to your Thank You page only:
Create another snippet in WPCode and restrict it to your Thank You page.

Paste this code:

<script src="https://script.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', { integration: "javascript" });

tap('conversion', 'Unique Conversion Id', Conversion amount, {customer_id: "Customer Id" });

</script>

Replace EXTERNAL_ID, AMOUNT, and CUSTOMER_ID with your dynamic values (e.g., order ID, total amount, and user/customer ID).

This setup works exactly like the plugin, it tracks visits via the detect script and logs conversions from your Thank You page.

This method is ideal for developers or advanced users who want flexibility or don’t wish to use the plugin interface.

2. PayPal Integration

If your checkout process uses PayPal, you can easily integrate Tapfiliate tracking by specifying PayPal as the provider in your shortcode.

Step 1: Update Your Shortcode

[tapfiliate provider="paypal"]

Then click Save.

Step 2: Configure PayPal

  1. Log in to your PayPal Business Account.

  2. Click the Settings (gear icon) in the top right → Account Settings.

  3. From the left menu, choose Website Payments.

  4. Find Website Preferences and click Update.

  5. Turn Auto Return to “On” and enter your Return URL (your Thank You page).

  6. Turn Payment Data Transfer (PDT) to “On”.

Note: PayPal integration is only available for Business Accounts.

3. Memberful Integration

If you are using Memberful to manage memberships or subscriptions on your WordPress site, follow the steps outlined in the official Memberful Integration Guide.

This ensures recurring payments and subscription renewals are tracked correctly within Tapfiliate.

4. Postback / S2S Tracking

For more advanced server-to-server tracking, Tapfiliate supports Postback (S2S) integration.

This approach allows you to send conversion data directly from your backend, bypassing browser-based tracking.

This method is typically used for:

  • Custom checkout systems

  • External payment gateways

  • Complex affiliate programs that need higher reliability

You can find the full implementation details in the Tapfiliate Postback / S2S Guide.

Test and Verify Your Setup

  1. Use an affiliate link to visit your site.

  2. Complete a test checkout or payment.

  3. Verify that the redirect URL contains the query parameters.

  4. Check your Tapfiliate dashboard to ensure the conversion is attributed correctly.

Example Scenario

Redirect URL after payment:

Shortcode on Thank You page:

[tapfiliate customer_id_query_param="sub_id" external_id_query_param="invoice_id" amount_query_param="amount" currency="USD"]

Result:

  • sub_id=1234 → Customer ID

  • invoice_id=5678 → External/Order ID

  • amount=100 → Sale amount

  • currency=USD

Tapfiliate records this as a conversion for the affiliate who referred the click.

Key Notes

  • The Thank You page must be on WordPress so the shortcode executes.

  • The redirect URL must include all query parameters mapped in your shortcode.

  • Missing parameters can cause incomplete tracking.

  • For dynamic currencies, use currency_id_query_param="currency" if your redirect URL includes ?currency=USD or similar.

  • Always test the full conversion flow: Affiliate link → Checkout → Thank You page → Dashboard validation.

Need More Help?

If you have any questions or if something in this guide is unclear, please don't hesitate to contact us at support@tapfiliate.com. We're happy to assist!

Did this answer your question?