How to track affiliate referrals from external websites
You can track referrals from an external website by carrying the affiliate ID from the first landing URL to your WordPress site, then letting your affiliate system set its tracking cookie. The manual method needs custom link or redirect logic; the faster route is AffiliateWP’s External Referral Links add-on.
- 01Map the referral journey
- 02Build the manual route
- 03Configure the external site
- 04Create and place referral links
- 05Test the complete conversion
- 06Use the faster plugin route
What you need
- A WordPress site where conversions take place
- An external website used by affiliates
- Affiliate tracking software on the main site
- Admin access to both sites
Map the referral journey
Write down the full path a visitor will take: affiliate link, external website, product or landing page, checkout, and confirmation. Decide which WordPress site records the conversion. The affiliate system only needs to be installed on that primary site when the external site is being used as a marketing or landing site.
If the affiliate link points straight to your store, use the normal referral URL, such as https://store.example/?ref=123. If the visitor lands on another domain first, the affiliate ID must be carried from that domain to the store. A normal cross-domain cookie will not do this by itself.
Build the manual route
For a manual setup, give each affiliate a landing URL containing an identifier, such as https://promo.example/?ref=123. On the external site, preserve that value in a first-party cookie or server-side session, then append it to every button or link that sends the visitor to the main WordPress site.
The main site must receive the identifier in the format its affiliate system accepts, usually a query parameter such as ?ref=123. This route is fine for a small number of campaigns, but you must maintain the code, preserve the parameter through redirects, and check that caching, consent tools, and URL builders do not remove it.
Configure the external site
If you use AffiliateWP’s External Referral Links add-on, install AffiliateWP on the primary conversion site and install the add-on on the external WordPress site. In the external site’s settings, enter the exact URL of the site where AffiliateWP is installed, including the correct HTTP or HTTPS protocol, then set the cookie expiry period and save the changes.
The add-on uses non-pretty referral URLs such as /?ref=123 or /?ref=john. Pretty links are not supported by this setup. Visits are recorded when the visitor reaches the primary site, not while they are browsing the external site.
Create and place referral links
Use the affiliate ID or username in each referral URL, then place the URL on the external site’s buttons, banners, articles, and calls to action. Check every destination, especially links that go to a product page, cart, or checkout rather than the home page.
If you need affiliates to generate their own links, AffiliateWP can output a referral URL for a chosen page using its referral URL shortcode. That is useful when each affiliate needs a different tracking value while promoting the same external campaign page.
Test the complete conversion
Open an affiliate link in a private browser window or on a separate device. Confirm that the external page loads, the onward link still contains the affiliate value, and the primary site records the visit or referral cookie. Complete a low-value test order and check the referrals screen after the integration processes it.
Do not test by typing the store URL directly after visiting the external page. Also check the failure cases: a redirect that strips ?ref=, a different HTTP and HTTPS protocol, a cached page with an old link, rejected cookies, and a customer switching browsers. Affiliate tracking normally depends on the browser retaining its tracking cookie.
Use the faster plugin route
For a working WordPress-to-WordPress setup, AffiliateWP with its External Referral Links add-on is the faster option. It handles the external-site referral cookie and passes the affiliate ID to the primary site, so you do not have to maintain custom URL and redirect code. Use the manual route when you only have a simple campaign and are comfortable maintaining it; use the add-on when several affiliates, pages, or external sites are involved.
Remember its limits: AffiliateWP only needs to run on the main conversion site, the external site needs the add-on, non-pretty referral URLs are required, and visits are recorded on the primary site rather than the external site.
Let AffiliateWP do it
Adds external referral links to AffiliateWP for cross-site conversion tracking when affiliates promote more than one WordPress site.
Tools that do this job
All of these solve the task above. They are listed as we have covered them.
Adds external referral links to AffiliateWP for cross-site conversion tracking when affiliates promote more than one WordPress site.
Checkout-based affiliate attribution for purchases missed by referral links, chosen when customers can name the referring affiliate.
Sources
- affiliatewp.com /docs/external-referral-links-installation-and-usage/?utm_so…
- affiliatewp.com /docs/affiliate_referral_url/?utm_source=openai
- affiliatewp.com /docs/common-questions-on-affiliate-tracking/?utm_source=ope…
- affiliatewp.com /docs/direct-link-tracking-installation-and-usage/?utm_sourc…
Questions
- Can I track an affiliate referral if the visitor lands on another domain first?
- Yes, but the affiliate identifier must reach the primary WordPress site. A direct link can carry the value in its query string, while an external-site setup can store the value temporarily and append it to the onward link. A normal cookie from one domain cannot simply be read by another domain, which is why the URL hand-off or a dedicated add-on is needed.
- Does AffiliateWP need to be installed on both websites?
- No, AffiliateWP only needs to be installed on the primary site where the sale or other conversion occurs. The external WordPress site uses the External Referral Links add-on to store the affiliate information and pass it along when the visitor clicks through. The primary site is where visits and conversions are recorded.
- Why are external affiliate referrals not being recorded?
- The usual causes are a referral parameter removed by a redirect, mismatched HTTP and HTTPS protocols, blocked or cleared cookies, an expired tracking period, or a visitor who did not arrive through the expected link. With direct-referrer tracking, bookmarks and typed URLs also fail because no referring page is available. Test the complete journey from the external link to the conversion rather than opening the store URL manually.
- Can I use pretty affiliate links for external referral tracking?
- Not with AffiliateWP’s External Referral Links add-on. Use the non-pretty format supported by the add-on, such as <code>https://promo.example/?ref=123</code> or <code>https://promo.example/?ref=john</code>. If your site normally uses pretty affiliate URLs, keep the external campaign links in the supported query-string format.
- What is the difference between external referral links and direct link tracking?
- External Referral Links carry an affiliate ID from an external WordPress site to the primary site, usually through a cookie and onward referral URL. Direct Link Tracking instead matches an approved referring domain to an affiliate. Direct tracking depends on the browser sending referrer information, so it can fail for bookmarks, typed URLs, some privacy-focused browsers, or an HTTPS site linking to an HTTP destination.