1. Documentation /
  2. Affiliate For WooCommerce /
  3. How to find, customize and share an affiliate referral link

How to find, customize and share an affiliate referral link

Affiliate for WooCommerce plugin helps you to add, manage affiliates, and track performance from a single place – commissions, sales, payout, leaderboard, etc. Earn money without hard work. Increase your brand outreach, and get potential customers.

This doc explains how the store admin and affiliates can find, share and customize an affiliate’s referral link.

Affiliate referral link

↑ Back to top

In affiliate marketing, affiliate referral links are the URLs your affiliates use to promote your products.

Through this link, Affiliate for WooCommerce tracks referred visits. Then, based on these visits, the plugin generates commissions for your affiliates once an order is successfully placed.

Each one of your affiliates will have their own unique link.

For example, if your website’s URL is https://demo.storeapps.org/, then the default referral link will look like this:

The referral link is built from your website’s home page URL followed by the ?ref=54 string (in the case of affiliate #54).

This string is made of two parts:

  1. the ref keyword, known as Tracking param name.
  2. the value associated with this variable, which, for the default referral link, is the affiliate’s user ID, known as the affiliate identifier.

Store admin can customize the Tracking param name and an affiliate can customize the affiliate ID/identifier.

Examples of various affiliate links:

Convert default referral links to pretty referral links

↑ Back to top

Using the Affiliate for WooCommerce plugin, you can prettify the affiliate referral links. Here’s how:

  1. Go to WordPress admin. Then either go to WooCommerce > Affiliates and click on the ‘Settings’ icon on the top right or go to WooCommerce > Settings > Affiliate.
  2. Locate ‘Pretty affiliate links’ and enable the checkbox next to it.
  3. Click on Save changes.

Settings doc reference.

After enabling, the above referral links will automatically look like this:

How can the store admin change the tracking param name?

↑ Back to top
  1. Go to WordPress admin. Then either go to WooCommerce > Affiliates and click on the ‘Settings’ icon on the top right or go to WooCommerce > Settings > Affiliate.
  2. Next to ‘Tracking param name’, change the ref as you wish. For example, change ‘ref’ to ‘aff’. The changes will be automatically reflected below the box.
  3. Click on Save changes.

That’s it.

Leaving the tracking param name empty will use the default value as ‘ref’.

Note – You can only add letters in the tracking param name and not numbers or special characters.

Settings doc reference.

How can affiliates customize/change their affiliate ID?

↑ Back to top

First, the store admin needs to allow their affiliates to change their affiliate identifier:

  1. Go to WordPress admin. Then either go to WooCommerce > Affiliates and click on the ‘Settings’ icon on the top right or go to WooCommerce > Settings > Affiliate.
  2. Locate ‘Personalize affiliate identifier’ and enable the checkbox next to it.
  3. Click on Save changes.

Settings doc reference.

Once enabled, Affiliates can customize their affiliate identifier/referral/tracking ID from their ‘My Account’ area by following these steps:

  1. Login to My Account > Affiliate > Profile.
  2. Click on the ‘pencil’ icon beside ‘Your affiliate identifier is’.
  3. Insert identifier i.e. own name, brand name, or other combination of letters only.
  4. Click on Save.

Now if that identifier is available, you will be able to use it else you will be prompted to enter a new value.

The new affiliate ID will be reflected beside the ‘Your referral URL is’ section and the new affiliate referral link will be visible next to the ‘Your referral URL is’ section.

Note – Default affiliate ID will be a number i.e. {user_id}. Affiliates can change it to a name for simplicity. However, numbers or special characters are not allowed.

How can store admins find and share referral links?

↑ Back to top

A store admin can find and share an affiliate’s referral link in either of the following ways:

Using the affiliate admin dashboard

↑ Back to top
  1. Go to the WordPress Admin panel > WooCommerce > Affiliates.
  2. Select any affiliate. On the right, you will find the ‘Referral Link’ for that affiliate.
  3. Alternatively, you can also click on the ‘Profile’ tab and find the ‘Referral Link’.
  4. To look for any particular affiliate, you can use the ‘Search’ box next to Plans and apply one or multiple filters based on your need (optional).
    More information and usage are explained in this doc.
  5. Copy the affiliate referral link from either of the above and click on the ‘Email Affiliate’ icon at the top right. And you can share an affiliate’s link and other details via that email.

Using the WordPress users option

↑ Back to top
  1. Go to your WordPress Admin > Users > All Users.
  2. Search/locate an affiliate user and edit that user’s details.
  3. Under the ‘Affiliate For WooCommerce settings’ section, you will find the ‘Referral link’.
  4. Copy the affiliate’s referral link and share it with them.

Campaigns

↑ Back to top

Please refer here for more information.

Change the default affiliate referral link

↑ Back to top

By default, an affiliate’s referral link points to your website homepage URL, and the same link is visible in the affiliate’s account as well as several other places like the admin side, campaigns etc.

In the affiliate My Account > Affiliate > Profile tab, if you want to change the default affiliate referral link from the home page to a different page (for example shop page), you can customize it via the ‘afwc_referral_redirection_url‘ filter.

Here are some examples to use/extend the above filter:

Example 1: change the home page link to the shop page link for all affiliates

add_filter( 'afwc_referral_redirection_url', 'storeapps_update_default_url', 10, 2 );
function storeapps_update_default_url( $url = '', $affiliate_id = 0 ) {
	if ( ! empty( $affiliate_id ) ) {
		$url = esc_url( home_url() .'/shop' );    // Replace shop page link without affiliate tracking param with your website's shop page link.
	}
	return $url;
}

Example 2: change the home page link to a product page link for a particular affiliate

Here you will need the affiliate’s user ID. To find it, go to WordPress admin > Users > All users. Hover on the ‘username’. WordPress will show the ‘user edit URL’ in a small box at the bottom left corner of the screen.

add_filter( 'afwc_referral_redirection_url', 'storeapps_update_default_url', 10, 2 );
function storeapps_update_default_url( $url = '', $affiliate_id = 0 ) {
	if ( ! empty( $affiliate_id ) && 1 === intval( $affiliate_id ) ) {  // Replace 1 with the affiliate's user ID.
		$url = esc_url( home_url() .'/gopro-hero' );    // Add product page link without affiliate tracking param.
	}
	return $url;
}

You can add the above code to your site by following either of the methods mentioned in this: How to properly add WooCommerce custom code

Important Note

The above method is considered customization. We are happy to provide guidance, but we are unable to provide support or help to suit your store. Only use it if you are comfortable with PHP and custom coding and troubleshooting on your own.

How can affiliates find and share their referral link?

↑ Back to top

An affiliate can locate their referral link and share it with their audience in either of the following ways:

Affiliate’s my account

↑ Back to top

Go to My Account > Affiliate

  1. under Profile (FAQ) tab
    • The referral link is visible under ‘Your referral URL is:‘
    • Click to copy and share the link.
  2. under the Campaigns tab to find any referral link-specific campaign and use it.

Affiliate’s welcome email

↑ Back to top

Each affiliate receives a welcome email when they sign up for your affiliate program. In this email, they will find all the necessary details along with a referral link to promote your products.

Tip: You can share all this information with your affiliates via an onboarding campaign.

How can affiliates generate custom referral links?

↑ Back to top

Please refer here for more information.

Tip: You can share this information with your affiliates via an onboarding campaign.

FAQ’s

↑ Back to top

1. Can the store admin customize an affiliate’s ID?

↑ Back to top

No, as of now only an affiliate can customize their affiliate ID.

But as a workaround, store admin can use any ‘user switching‘ or ‘login as any user‘ or ‘View Admin As‘ (recommended here) plugins to log in to an affiliate’s account and change their affiliate ID as explained above.

Note: We do not recommend any particular plugin. You can check and install a plugin that fits your site/requirements.

2. Why can’t I change the affiliate ID to any other number?

↑ Back to top

By default, an affiliate’s ID is their user ID. An affiliate ID cannot be changed to another number due to the potential risk of conflict with another user’s ID.

3. Can two affiliates have the same affiliate ID?

↑ Back to top

No. The plugin will promote you to enter a different affiliate ID if the one you are trying to use is already taken by another affiliate.

Feature request

↑ Back to top

Have a feature request or enhancement suggestion for Affiliate For WooCommerce? Submit it from here: Submit a feature request or send it to us from here.